我正试图从‘https://www.akrapovic.com/en/car/product/16722/Ferrari/488-GTB-488-Spider/Slip-On-Line-Titanium?brandId=20&modelId=785&yearId=5447'。我已经写了以下代码,但它给了我错误。
driver.get('https://www.akrapovic.com/en/car/product/16722/Ferrari/488-GTB-488-Spider/Slip-On-Line-Titanium?brandId=20&modelId=785&yearId=5447')
audio_link = driver.find_element(By.XPATH,'//*[@class="container-xl"]')
print(audio_link.find_element(By.CSS_SELECTOR,'audio'))
希望能找到更好的方法来刮。
您可以简单地使用
driver.find_element(By.XPATH,'//audio')