【发布时间】:2019-10-10 04:51:33
【问题描述】:
我在 Jupyter 笔记本上使用 BeautifulSoup 来解析来自该网站 (http://www.jepoc.or.jp/hydro/index.php?_w=usData&_x=areashow3) 的 HTML 数据。我只需要表格中的数据(标题和值)。
但是,似乎解析的汤对象仅显示表头中的值,而所有表值项(例如数值)都丢失了。来自 <tr class = "rowOdd"> 和 <tr class = "rowEven"> 的数据丢失。
这是我写的代码:
import requests
r = requests.get("http://www.jepoc.or.jp/hydro/index.php?_w=usData&_x=areashow3")
print(len(r.text))
from bs4 import BeautifulSoup
soup = BeautifulSoup(r.text,"html5")
soup
【问题讨论】:
标签: python web-scraping beautifulsoup