Try:
find_elements_by_xpath("//*")That should match all elements in the document.
UPDATE (to match question refinements):
Use javascript and return the DOM as a string:
execute_script("return document.documentElement.outerHTML")
Try:
find_elements_by_xpath("//*")That should match all elements in the document.
UPDATE (to match question refinements):
Use javascript and return the DOM as a string:
execute_script("return document.documentElement.outerHTML")