【发布时间】:2022-01-13 02:00:17
【问题描述】:
我试图通过网络抓取所有表格 N-MFP2,然后打开链接以抓取表格中的信息。但是,我被困在检索表格上。我尝试了多种网页抓取方法,包括beautifulSoup和selenium,但返回的是空的,我无法进一步获取行数据。感谢任何帮助,因为我已经解决了这个问题超过 3 个小时。
我的代码如下:
# Create an URL object
url = 'https://www.sec.gov/edgar/browse/?CIK=843781'
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser') # it does not work even with "lxml"
# Obtain information from tag <table>
table = soup.find("table", id="filingsTable")
网页:https://www.sec.gov/edgar/browse/?CIK=843781
The table screenshot is here; Form N-MFP2 is highlighted as red
【问题讨论】:
-
BeautifulSoup不执行 JavaScript。
标签: python beautifulsoup