Issue
Here is my scrapy project folder I captured in my pycharm
items.py
import scrapy
class MyscraperItem(scrapy.Item):
title = scrapy.Field()
writer = scrapy.Field()
preview = scrapy.Field()
settings.py
BOT_NAME = 'myscraper'
SPIDER_MODULES = ['myscraper.spiders']
NEWSPIDER_MODULE = 'myscraper.spiders'
There is error for "from myscraper.items import MyscraperItem" however, it works when it(mybot.py) run.
I don't know what is wrong.
Solution
Your top directory is also called myscraper
, PyCharm starts there.
If you use from myscraper.myscraper.items import MyscraperItem
it will work.
Answered By - Trevis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.