我已经到处寻找解决这个问题的方法。我以前调用“from scrapy.contrib...”没有问题,但是现在它抛出了这个错误。
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'scrapy.contrib'
在这里张贴是最后的手段。任何帮助在这里将是非常欢迎的。
4条答案
按热度按时间uajslkp61#
scrapy.contrib
已经过时很久了。它在1.6版本的Scrapy中被删除。
有关详细信息,请访问https://docs.scrapy.org/en/latest/news.html#deprecation-removals
xggvc2p62#
从scrappy.链接提取器.sgml导入SgmlLink提取器
yptwkmov3#
up9lanfz4#
只需要删除contrib并从scrapy中写入如下命令。linkextractor从scrapy中导入LinkExtractor。spider导入CrawlSpider,Rule