在这里,https://forecast.vassarlabs.com/,我想提取降雨量表数据;为了检查表格,您必须单击右上角的菜单图标。我想提取此数据表。
我的代码:
from urllib.request import urlopen
import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import os
driver = webdriver.Chrome("C:/Users/DELL/Desktop/chromedriver.exe")
driver.get('https://forecast.vassarlabs.com/')
res = driver.execute_script("return document.documentElement.outerHTML")
driver.quit()
soup = BeautifulSoup(res, 'html.parser')
table = soup.find("div",class_='content-wrap')
ta=table.find('table',class_="table table-bordered table-striped responsive no-m ng-scope")
print(ta)
慕桂英3389331
胡说叔叔
相关分类