简体   繁体   English

点击 web 上的按钮抓取

[英]Clicking button on web scraping

I am trying to do web scraping in this web page我正在尝试在此 web 页面中进行 web 抓取

https://www.camara.cl/pley/pley_detalle.aspx?prmID=13505&prmBL=712960-07 https://www.camara.cl/pley/pley_detalle.aspx?prmID=13505&prmBL=712960-07

And I am trying to obtain the information in the table that is contain in Autores.我正在尝试获取 Autores 中包含的表中的信息。

I have tried using this code我试过使用这段代码

        button=browser.find_element_by_link_text('Autores')
        button.click()
        soup_level2=BeautifulSoup(browser.page_source, 'lxml')

But the click is not working.但是点击不起作用。

This should do:这应该这样做:

browser=webdriver.Chrome()

url = "https://www.camara.cl/pley/pley_detalle.aspx?prmID=13505&prmBL=712960-07"

browser.get(url) #navigate to the page

browser.find_element_by_id("ctl00_mainPlaceHolder_btnAutores").click()



innerHTML = browser.execute_script("return document.body.innerHTML")
soup_level2=BeautifulSoup(innerHTML, 'html.parser')

PS: Your sister Vale is one of my thesis professors, small world ! PS:你姐姐Vale是我的论文教授之一,小世界!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM