我正在尝试通过web刮取此网站:https://www.reuters.com/companies/tsla.oq/financials/income-statement-quarterly
我正在使用Python,除了日期部分之外,所有内容都可以删除。。。i、 e.我不能刮“6月30日-20日”。我试着
from requests import get
from bs4 import BeautifulSoup
url = 'https://www.reuters.com/companies/tsla.oq/financials/income-statement-quarterly'
response = get(url)
html_soup = BeautifulSoup(response.text, 'html.parser')
table = html_soup.find_all('div', class_ = 'tables-container')
table[0].thead.tr.find('time', class_ = 'TextLabel__text-label___3oCVw TextLabel__black___2FN-Z TextLabel__medium___t9PWg').text
但它显示空白。。。你能帮帮我吗?我们将不胜感激
您无法使用动态添加数据的请求(使用javascript)从网站获取数据。 您需要使用selenium来实现这一点
请参阅此代码:
相关问题 更多 >
编程相关推荐