问题
import Scrapy
class NgaSpider(Scrapy.Spider):
name = "NgaSpider"
host = "http://bbs.ngacn.cc/"
start_urls = [
"http://bbs.ngacn.cc/thread.php?fid=406",
]
def parse(self, response):
print ("response.body")
Error: ModuleNotFoundError: No module named 'Scrapy'
What is going on to fix this issue?
回答1:
You are incorrectly importing the scrapy module.
Find a simple tutorial and references from here.
You have to do the following changes:
import scrapy # Change here
class NgaSpider(scrapy.Spider): # Change here too
name = "NgaSpider"
host = "http://bbs.ngacn.cc/"
start_urls = [
"http://bbs.ngacn.cc/thread.php?fid=406",
]
def parse(self, response):
print ("response.body")
Assuming you are using 1.3 version of it.
To check use
pip show scrapy
来源:https://stackoverflow.com/questions/42967930/modulenotfounderror-no-module-named-scrapy