25

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
  • 49,954
  • 14
  • 144
  • 128
Chris Dutrow
  • 45,764
  • 62
  • 180
  • 249

1 Answers1

62

Looks like the entire page text can be found in:

driver.page_source
Chris Dutrow
  • 45,764
  • 62
  • 180
  • 249