[英]Crawling an .net site with subdomain
我正在尝试使用php curl爬行.net网站。 我要抓取的网站是
http://waltham.patriotproperties.com
我能够抓取该网站。
但是当我尝试抓取内部页面时
http://waltham.patriotproperties.com/about.asp
或该子域内的任何其他页面,它给我以下错误
The page cannot be displayed because an internal server error has occurred.1
我正在使用的代码如下
$ch = curl_init();
$urlLogin = "http://www.waltham.patriotproperties.com";
curl_setopt($ch, CURLOPT_URL, $urlLogin);
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
//curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
echo $data;
该代码适用于
http://waltham.patriotproperties.com/
但不适用于
http://waltham.patriotproperties.com/search.asp
http://waltham.patriotproperties.com/summary.asp
即该子域内的任何网址。 我在子域内使用url得到的错误是
HTTP/1.1 500 Internal Server Error
Content-Type: text/html
Server: Microsoft-IIS/7.5
Date: Wed, 05 Jun 2013 16:33:57 GMT
Content-Length: 75
您将从以下位置开始:
$urlLogin = "http://www.waltham.patriotproperties.com";
但是搜索页面的链接位于:
http://waltham.patriotproperties.com/search.asp
如果您浏览该URL,您将看到内容。 如果您添加www.
到URL的开头,它可以正常工作。
编辑添加 -如果他们有可以使用的API,这将变得容易得多 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.