全球主机交流论坛

标题: 还要再请教个spider问题。 [打印本页]

作者: 猛犸    时间: 2019-10-15 14:51
标题: 还要再请教个spider问题。
本帖最后由 猛犸 于 2019-10-15 14:57 编辑

我用的spider+selenium+headless chrome
方案是在fetcher里边加了个selenium_fetcher.py
运行时先开一个chrome web server 端口9000
然后运行pyspider --phantomjs-proxy=http://0.0.0.0:9000

正常采集没问题,但是一使用  fetch_type='js' 调用selenium就报错

pyspider错误提示:ValueError('No JSON object could be decoded',)
chrome web server错误提示:post 500  get 404
selenium/webdriver/remote/errorhandler.py", line 208, in check_response
    raise exception_class(value)
最终显示采到的页面是404页面

伪造了user-agent

在 chrome web server上能看到fetch传递过来的json

接下来就出错了。

求大神指点,忙活2个晚上了。




欢迎光临 全球主机交流论坛 (https://loc.010206.xyz/) Powered by Discuz! X3.4