我正在尝试从 StockX 中提取这款运动鞋的最新出价,但收到错误消息
IndexError: list index out of range
因为由于sneaker_price某种原因出现空白。有人可以帮忙吗?:
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]
阿晨1998
萧十郎
相关分类