我正在python3中開發(fā)亞馬遜網(wǎng)絡(luò)抓取腳本,所以我使用了硒,但我得到了這個(gè)調(diào)試webdriver.chrome()TypeError: 'module' object is not callable 我看到了更改的解決方案(鉻到鉻),但我也有這個(gè)調(diào)試FileNotFoundError: [WinError 2] The system cannot find the file specified這是我的代碼# -*- coding: utf-8 -*-import requestsfrom bs4 import BeautifulSoupfrom selenium import webdriverdriver = 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)
1 回答

開滿天機(jī)
TA貢獻(xiàn)1786條經(jīng)驗(yàn) 獲得超13個(gè)贊
我相信它應(yīng)該是,而不是。嘗試:Chrome()chrome()
from selenium import webdriver
driver = webdriver.Chrome()
您也可以將路徑傳遞給Chromedriver,將executable_path設(shè)置為chromedriver所在的位置(路徑,或者,對于非Windows用戶,它只稱為):chromedriver.exechromedriver
driver = webdriver.Chrome(executable_path='C:/path/to/chromedriver.exe')
添加回答
舉報(bào)
0/150
提交
取消