缺少HTML输出[BeautifulSoup]

2024-10-03 04:38:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用Jupyter笔记本上的BeautifulSoup解析这个网站(http://www.jepoc.or.jp/hydro/index.php?_w=usData&_x=areashow3)的HTML数据。我只需要表中的数据(标题和值)

但是,解析的soup对象似乎只显示来自表头的值,而缺少所有表值项(例如数值)。来自<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

Tags: or数据httpindexwwwtrclassphp