Skip to main content

Get the whole updated HTML source code from every frame (not driver.page_source)

Project description

Get the whole updated HTML source code from every frame (not driver.page_source)

https://stackoverflow.com/a/71763545/15096247

To conclude where as the page source obtained from driver.page_source is more or less is an artist's impression of the DOM Tree, Element.outerHTML gets the serialized HTML fragment describing the element including its descendants.

# Tested with:
# https://github.com/ultrafunkamsterdam/undetected-chromedriver
# Python 3.9.13
# Windows 10

$pip a-selenium-get-source-from-all-frames

from time import sleep
from a_selenium_kill import add_kill_selenium
from auto_download_undetected_chromedriver import download_undetected_chromedriver
import undetected_chromedriver as uc
from a_selenium_get_source_from_all_frames import get_sourcecode_from_all_frames


@add_kill_selenium  # https://github.com/hansalemaos/a_selenium_kill
def get_driver():
    folderchromedriver = "f:\\seleniumdriver2"
    path = download_undetected_chromedriver(
        folder_path_for_exe=folderchromedriver, undetected=True
    )  # https://github.com/hansalemaos/auto_download_undetected_chromedriver
    driver = uc.Chrome(driver_executable_path=path)
    return driver


if __name__ == "__main__":
    folderchromedriver = "f:\\seleniumdriver3"
    path = download_undetected_chromedriver(
        folder_path_for_exe=folderchromedriver, undetected=True
    )
    driver = get_driver()
    driver.get(r"https://demo.guru99.com/test/guru99home/")
    sleep(4)
    source = get_sourcecode_from_all_frames(
        driver,
    )

    
	

Project details


Release history Release notifications | RSS feed

This version

0.10

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file a_selenium_get_source_from_all_frames-0.10.tar.gz.

File metadata

File hashes

Hashes for a_selenium_get_source_from_all_frames-0.10.tar.gz
Algorithm Hash digest
SHA256 e23e83d09827090acfb5c512fd3a71566763033f740ce8bde4fc7943290147d2
MD5 5be5e59f6f9f130c6f1d5e83ddbca791
BLAKE2b-256 47de4d028bef8f2a9e60bec8ef9d0d2df56eaedebfebd55f9a6f943db90a3a6e

See more details on using hashes here.

File details

Details for the file a_selenium_get_source_from_all_frames-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for a_selenium_get_source_from_all_frames-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 72c8c1b9136ad1c1c19aa406e1a69b350a603b30d013ea71cac896d9c04f6941
MD5 207208d6a87ad8f09d85bcbcdc717c10
BLAKE2b-256 649b439fe25518e3a500da59684c9bfa6e77323e554f689e6e2d34b6979c1bf1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page