Python Selenium 'WebDriver' object has no attribute error
- You only need
from selenium import webdriver
. - Execute
html= browser.find_element_by_xpath(".//html")
to get the html element on the page, the largest element. (You can do this any number of ways, and select any number of elements. ) - Execute
html.text
to return the text of the page.
.text
is a method of an element
object. Step 2 is the assignment of the element
to the name html
.