Python 为什么我的webscraper返回[]到powershell?

Python 为什么我的webscraper返回[]到powershell?,python,selenium,web-scraping,beautifulsoup,webdriver,Python,Selenium,Web Scraping,Beautifulsoup,Webdriver,使用python、BeautifulSoup和Selenium的webscraper返回“[]”。最初,我只是使用BeautifulSoup,也遇到了同样的问题,因为我试图获取的是天气数据,所以我尝试使用selenium。 这是代码和html片段,我对这一点非常陌生,所以提前谢谢:) html 9(g15)英里/小时西 我不明白,您在代码中引用的类与HTML不一样。至少在我的firefox上,它们也不是网站的一部分。请查看您的代码并确定您要查找的内容。如果您试图查找jw列表视图wind desc

使用python、BeautifulSoup和Selenium的webscraper返回“[]”。最初,我只是使用BeautifulSoup,也遇到了同样的问题,因为我试图获取的是天气数据,所以我尝试使用selenium。 这是代码和html片段,我对这一点非常陌生,所以提前谢谢:)

html

<代码>9(g15)英里/小时西
我不明白,您在代码中引用的类与HTML不一样。至少在我的firefox上,它们也不是网站的一部分。请查看您的代码并确定您要查找的内容。如果您试图查找
jw列表视图wind desc
,但您有
driver.find\u elements\u by\u class\u name(“jw spot list marker”)
,您将无法找到它。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
import time

driver = webdriver.Chrome()

driver.get("https://wx.ikitesurf.com/spot/93670")

time.sleep(5)

windspeed = driver.find_elements_by_class_name("jw-spot-list-marker")

print (windspeed)
  
driver.close() 
<span class="jw-list-view-wind-desc">9 (g15) mph W</span>