使用python和硒抓取交易页面亚马逊

时间:2020-03-18 05:11:56

标签: javascript python selenium web-scraping command-line

我想使用python和硒来在亚马逊中取消交易页面,但是我没有从我想要的主要部分中获取任何数据,首先打开chrome驱动程序,然后关闭并给我此消息

DevTools listening on ws://127.0.0.1:49184/devtools/browser/9a667fff-1a27-4181-8829-dba1d4f99d5a

然后没有数据可获取

# -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
driver = webdriver.Chrome(executable_path='C:\\Users\\Compu City\\Desktop\\chromedriver.exe')
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')

for y in soup.find_all('div',{'class':'a-row a-spacing-mini'}):
     print(y)

0 个答案:

没有答案