owner888 / phpspider

《我用爬虫一天时间“偷了”知乎一百万用户,只为证明PHP是世界上最好的语言 》所使用的程序
3.49k stars 1.18k forks source link

getcookie 函数失效 #64

Open beerkala opened 7 years ago

beerkala commented 7 years ago

getcookie 函数无法正确获取,获取的url不支持https://github.com/owner888/phpspider/issues/new多路径网址。

$spider->on_start = function($phpspider) { $cookie = requests::get_cookie("SUB", "s.weibo.com"); // 把Cookie设置到 weibo.com 域名下 requests::set_cookie("SUB", $cookie, "weibo.com"); };

BrainGithub commented 7 years ago

see see

owner888 commented 7 years ago

在on_start里面不可能就有cookie的啊,所以肯定是空的啊