Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python chrome()类型错误:';模块';对象不可调用_Python_Selenium_Selenium Webdriver_Web Scraping_Scrapy - Fatal编程技术网

Python chrome()类型错误:';模块';对象不可调用

Python chrome()类型错误:';模块';对象不可调用,python,selenium,selenium-webdriver,web-scraping,scrapy,Python,Selenium,Selenium Webdriver,Web Scraping,Scrapy,我正在使用python3编写amazon web抓取脚本,所以我使用了selenium,但我得到了这个调试 webdriver.chrome() TypeError: 'module' object is not callable 我看到了改变(从chrome到chrome)的解决方案,但我也得到了这个调试 FileNotFoundError: [WinError 2] The system cannot find the file specified 这是我的密码 # -*- codin

我正在使用python3编写amazon web抓取脚本,所以我使用了selenium,但我得到了这个调试

webdriver.chrome()
TypeError: 'module' object is not callable 
我看到了改变(从chrome到chrome)的解决方案,但我也得到了这个调试

FileNotFoundError: [WinError 2] The system cannot find the file specified
这是我的密码

# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from selenium import webdriver

driver = webdriver.chrome()
driver.get('https://www.amazon.com/international-sales-offers/b/?ie=UTF8&node=15529609011&ref_=nav_navm_intl_deal_btn')
res = driver.execute_script("return document.documentElement.outerHTML")
driver.quit()
soup = BeautifulSoup(res , 'lxml')
box= soup.find('div',{'class':'a-row padCenterContainer widgetBorder'})
products=box.find_all('div',{'class':'a-section a-spacing-none tallCellView gridColumn5 singleCell'})
for details in products:
    name= details.find('span',{'class':'a-declarative'}).text
    link= details.find('a',{'class':'a-size-base a-link-normal dealTitleTwoLine singleCellTitle autoHeight'}).get('href')
    print(name,link)

我认为应该是
Chrome()
,而不是
Chrome()
。尝试:

from selenium import webdriver

driver = webdriver.Chrome()
您也可以将路径传递给Chromedriver,将可执行路径设置为Chromedriver所在的位置(路径为
Chromedriver.exe
,或者,对于非Windows用户,仅称为
Chromedriver
):


你下载了chrome webdriver吗?请提供完整的错误消息。你能提供完整的错误消息,以便我们更好地了解你所遇到的错误吗?@EslamAhmed我用另一个解决方案编辑了我的答案我成功了,但现在它没有给我任何我想要的部分的数据,并给我这个消息DevTools在ws://127.0.0.1:65378/DevTools/browser/4ff38b27-22be-4d7d-8fc8-f913a8b1090c上侦听```
driver = webdriver.Chrome(executable_path='C:/path/to/chromedriver.exe')