为什么我的网络爬虫将[]返回到Powershell?

时间:2020-09-02 23:24:57

标签: python selenium web-scraping beautifulsoup webdriver

我的使用python,BeautifulSoup和Selenium的Webscraper返回“ []”。最初我只是使用BeautifulSoup并遇到相同的问题,由于我要抓取的是天气数据,因此我尝试使用硒。 这是代码和html代码段,对此我真的很陌生,所以在此先谢谢你:)

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() 

html

<span class="jw-list-view-wind-desc">9 (g15) mph W</span>

0 个答案:

没有答案