27

Using Selenium for browser automation (Python).

If I understand correctly, the following code would be used

inputElement = driver.find_element_by_name("q")
the_text = inputElement.text

How would I go about getting the text on the whole page as opposed to looking within a particular element?

Asclepius
  • 57,944
  • 17
  • 167
  • 143
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258

1 Answers1

65

Looks like the entire page text can be found in:

driver.page_source
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258