【发布时间】:2022-01-04 23:56:43
【问题描述】:
我需要在 Python 中使用美洲 500 强公司的信息做一个 DataFrame:
我尝试进行网络报废,当我打印(tabla)时,它显示 [] 或 None...
from bs4 import BeautifulSoup
import requests
url = 'https://www.americaeconomia.com/negocios-industrias/estas-son-las-500-mayores-empresas-de-america-latina-2021'
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
tabla = soup.find('table', {"id":"awesomeTable"})
print(tabla)
【问题讨论】:
标签: python web web-scraping html-table