我正在尝试从以下网站获取搜索结果作为表格: https://www.handelsregister.de/rp_web/result.do?Page=1
但它返回一个空表。我正在使用以下代码:
from urllib.request import urlopen
from bs4 import BeautifulSoup as BS
from requests import get
url = "https://www.handelsregister.de/rp_web/result.do?Page=1"
html = urlopen(url)
soup = BS(html, 'lxml')
table = soup2.find_all('table')
#table = soup.find_all('table', class_ = 'RegPortErg')
#table = soup.find('table', {'class': 'RegPortErg'})
print(table)
请尝试以下操作,而不是
html = urlopen(url)
:它不是一个非常干净的表来解析,但是您可以使用
requests.post()
:输出:
相关问题 更多 >
编程相关推荐