【发布时间】:2021-01-07 23:33:24
【问题描述】:
全部。我正在尝试从 StockX 提取这款运动鞋的最新出价,但由于某种原因,sneaker_price 出现空白,我收到错误“IndexError:list index out of range”。有人可以帮忙吗?:
from bs4 import BeautifulSoup
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://stockx.com/air-jordan-6-retro-travis-scott")
soup = BeautifulSoup(driver.page_source,"lxml")
driver.quit()
sneaker_price = soup.select("div.en-us stat-value stat-small")[0]
【问题讨论】:
-
请分享HTML元素
标签: python web-scraping beautifulsoup screen-scraping