【发布时间】:2014-02-14 03:04:00
【问题描述】:
我尝试在this html 框架中获取表格信息。我的意思是有列的表:
Year,Month,Oil Production m3,Gas Production Ksm3,...
使用beautifulSoup,这是迄今为止我尝试过的:
from bs4 import BeautifulSoup
from urllib import urlopen, urlretrieve, quote
url_base = 'https://www.og.decc.gov.uk/information/wells/pprs/Well_production_onshore_oil_fields/onshore_oil_fields_by_well/onshore_oil_fields_by_wel.html'
u = urlopen(url_base)
html = u.read().decode('utf-8')
u.close()
soup = BeautifulSoup(html)
但这仅检索主页信息,而不是页面框架。 当我通过框架链接更改 url base 时,它告诉我请求的页面已过时。
【问题讨论】:
-
请更清楚地解释您的问题,因为当我加载页面时,我会在侧边栏菜单中看到所有页面,而您只需单击或引用它的 url
标签: python beautifulsoup screen-scraping html-frames