我正在嘗試從以下位置執行 Twitter scraper 程式碼:https://github.com/jonbakerfish/TweetScraper
當我在命令提示字元中執行命令scrapy list
以確保刮刀已正確設定時,出現以下錯誤:
from scrapy.conf import settings
ModuleNotFoundError: No module named 'scrapy.conf'".
我嘗試過重新安裝scrapy等很多方法,但似乎都是徒勞無功。有人可以幫我嗎?
答案1
正如 Augusto Men 上面提到的,scrapy.conf
已被棄用。若要使用 Scrapy >= v1.7 存取專案設置,請使用:
from scrapy.utils.project import get_project_settings
settings = get_project_settings()
# Use the settings
答案2
我認為問這個問題的地方是 Stack Overflow,但為了回答你的問題,該模組scrapy.conf
已在 Scrapy 1.7 中被棄用並刪除(http://docs.scrapy.org/en/latest/news.html#deprecation-removals)。