How to get innerHTML of whole page in selenium driver?

前端 未结 3 378
予麋鹿
予麋鹿 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 11:12

    Using page object:

    @FindBy(xpath = "xapth")
    private WebElement element;
    
    public String getInnnerHtml() {
        System.out.println(waitUntilElementToBeClickable(element, 10).getAttribute("innerHTML"));
        return waitUntilElementToBeClickable(element, 10).getAttribute("innerHTML")
    }
    

提交回复
热议问题