from scrapy.selector import HtmlXPathSelector
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'HtmlXPathSelector'
File "/mnt/d/www/Movie-scrapy/movie/movie/spiders/mtime_spider.py", line 2, in <module>
from scrapy.spider import BaseSpider
ModuleNotFoundError: No module named 'scrapy.spider'
我自己尝试写用scrapy抓取的时候,mtime经常会返回521,猜测是js cookie的验证问题。最终只能选择selenium。不知道库主的代码,是否会有这个问题?测试了,确实有这个问题
INFO: Ignoring response <521 http://movie.mtime.com/50004/>: HTTP status code is not handled or not allowed
pip3 install 'scrapy==1.5.2'
pip3 install pillow
pip3 install pymongo