【问题标题】:Unable to scrape audio for webpage无法为网页抓取音频
【发布时间】:2022-01-24 00:54:19
【问题描述】:

我正在尝试从“https://www.akrapovic.com/en/car/product/16722/Ferrari/488-GTB-488-Spider/Slip-On-Line”中抓取音频(体验声音) -钛?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'))     

希望能找到更好的方法来刮。

【问题讨论】:

    标签: python selenium web-scraping selenium-chromedriver


    【解决方案1】:

    你可以简单地使用

    driver.find_element(By.XPATH,'//audio')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-18
      • 2021-04-10
      • 1970-01-01
      相关资源
      最近更新 更多