正巧碰上 scrapy1.3.0更新成1.3.1
導致部分引用模組的錯誤 因此記下修正的紀錄
ScrapyDeprecationWarning: Module `scrapy.log` has been deprecated, Scrapy now relies on the builtin Python library for logging. Read the updated logging entry in the documentation to learn more. from scrapy import log
scrapy.log在1.3.1版本中已經被棄用 改用python原本使用的log功能
原程式碼
from scrapy import log
log.msg('A warning message!!')
修正後
import logging logging.warning("This is a warning")
參照網頁:https://doc.scrapy.org/en/latest/topics/logging.html
crapyDeprecationWarning: Module `scrapy.conf` is deprecated, use `crawler.settings` attribute instead from scrapy.conf import settings
scrapy.conf在1.3.1版本中已經被棄用 改為crawler.settings
原程式碼
from scrapy.conf import settings
connection = pymongo.MongoClient(
settings['MONGODB_SERVER'],
settings['MONGODB_PORT'])
...等setting['....']相關
修正後(尚不確定)
from scrapy import crawler
沒有留言:
張貼留言