当我编写“ import scrapy”以将该库导入我的python文件时,在运行时给出错误“ ModuleNotFoundError:没有名为“ scrapy”的模块”,并且我还使用
安装了scrapypip install scrapy
#enter code here
import bs4 as bs
import urllib.request
import scrapy
i = input('enter the item to be searched :')
i = i.replace(" ","")
sauce1 = urllib.request.urlopen('https://www.amazon.in/s/ref=nb_sb_noss?
url=search-alias%3Daps&field-keywords='+i).read()
soup1 = bs.BeautifulSoup(sauce1,'lxml')
s_url = []
ul_parent = soup1.find('div', class_='a-row s-result-list-parent-container')
for url in ul_parent.find_all('a'):
if "javascript" not in str(url.get('href')):
s_url.append(str(url.get('href')))
print(s_url)
当我想使用“ response.xpath”从亚马逊网站提取商品时,该如何导入scrapy。请帮忙 谢谢
答案 0 :(得分:0)
答案 1 :(得分:0)
1。为您的python版本安装Scrapy
pip install scrapy
2。然后将其导入到您的python文件中
import scrapy
答案 2 :(得分:0)
请尝试使用pip install scrapy
安装scrapy,然后尝试导入scrapy。