现在做采集
采集的页面是根据语言自动变化的
采集的目标网站设置语言的是另外一个页面
所以必须在采集之前把设置语言的页面访问一次
以便在服务器的IE缓存写入cookie
比如服务器设置的语言地址
http://www.rs100.cn/default.aspx?setlang=en //设置为英语,默认为德语
访问采集列表为
http://www.rs100.cn/oddTomorrow.aspx
现在php里面
$url="http://www.rs100.cn/oddTomorrow.aspx";
$fp=@fopen($url,"r") or die("超时");
$fcontents=file_get_contents($url);
这样下来的为德语
原因是服务器的IE缓存里面没有 语言的cookie为直接打开网站的
怎么在程序里面先让服务器访问一下 http://www.rs100.cn/default.aspx?setlang=en这个地址呢
$cookieurl="http://www.bet-at-home.com/default.aspx?setlang=en";
$cookiefp=@fopen($cookieurl,"r") or die("超时");
经测试 这样写在前面 不成功