How to get innerHTML of whole page in selenium driver?

前端 未结 3 374
予麋鹿
予麋鹿 2020-12-10 10:40

I\'m using selenium to click to the web page I want, and then parse the web page using Beautiful Soup.

Somebody has shown how to get inner

3条回答
  •  情歌与酒
    2020-12-10 10:56

    driver.page_source probably outdated. Following worked for me

    let html = await driver.getPageSource();
    

    Reference: https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/ie_exports_Driver.html#getPageSource

提交回复
热议问题