【发布时间】:2021-09-21 23:37:57
【问题描述】:
我正在尝试用 BS4 和 Selenium 搜索巴西债券(BS4 本身收集的信息比 Selenium 还要少)。
当我在 BeautifulSoup 之后打印网页时,::before 之后的表格不显示,我尝试在表格应该开始的地方使用 find_all('div', class_="col-lg-12"),我得到一个空数组。
有没有办法让该内容显示出来?我已经尝试过使用隐式等待,但信息也没有加载。
这是我的代码:
url = 'http://web.cvm.gov.br/app/esforcosrestritos/#/detalharOferta?ano=MjAyMQ%3D%3D&valor=MTU%3D&comunicado=MQ%3D%3D&situacao=MQ%3D%3D'
driver = webdriver.Chrome('C:/webdrivers/chromedriver.exe')
driver.get(url)
html = driver.page_source
soup = BeautifulSoup(html, 'html.parser')
tags = soup.find_all('div', class_="col-lg-12")
print(tags)
【问题讨论】:
标签: python selenium-webdriver web-scraping beautifulsoup