-1

How to print all html/css tags/attributes of "browser"?

from selenium import webdriver
browser = webdriver.Firefox()
browser.get('http://seleniumhq.org/')
user3013157
  • 109
  • 1
  • 9
  • what do you mean by all html attributes ? Do you want all divs, span, iframe etc as your output. – cruisepandey Aug 05 '19 at 09:24
  • 1
    Possible duplicate of [Python WebDriver how to print whole page source (html)](https://stackoverflow.com/questions/27411915/python-webdriver-how-to-print-whole-page-source-html) – Nouman Aug 05 '19 at 09:25

2 Answers2

0
System.out.println(browser.getPageSource());
sanj
  • 16
  • 3
0

Answering my own question, for those who might find it useful in the future:

print(browser.page_source)

In general, to check/print/list ALL Methods and Attributes available to an Object use this:

print(dir(browser))
user3013157
  • 109
  • 1
  • 9