# 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.**
```python
# 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,
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/a_selenium_get_source_from_all_frames",
"name": "a-selenium-get-source-from-all-frames",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Selenium,frames,source,html",
"author": "Johannes Fischer",
"author_email": "<aulasparticularesdealemaosp@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/47/de/4d028bef8f2a9e60bec8ef9d0d2df56eaedebfebd55f9a6f943db90a3a6e/a_selenium_get_source_from_all_frames-0.10.tar.gz",
"platform": null,
"description": "\n# Get the whole updated HTML source code from every frame (not driver.page_source)\n\n#### https://stackoverflow.com/a/71763545/15096247\n\n**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.**\n\n```python\n# Tested with:\n# https://github.com/ultrafunkamsterdam/undetected-chromedriver\n# Python 3.9.13\n# Windows 10\n\n$pip a-selenium-get-source-from-all-frames\n\nfrom time import sleep\nfrom a_selenium_kill import add_kill_selenium\nfrom auto_download_undetected_chromedriver import download_undetected_chromedriver\nimport undetected_chromedriver as uc\nfrom a_selenium_get_source_from_all_frames import get_sourcecode_from_all_frames\n\n\n@add_kill_selenium # https://github.com/hansalemaos/a_selenium_kill\ndef get_driver():\n folderchromedriver = \"f:\\\\seleniumdriver2\"\n path = download_undetected_chromedriver(\n folder_path_for_exe=folderchromedriver, undetected=True\n ) # https://github.com/hansalemaos/auto_download_undetected_chromedriver\n driver = uc.Chrome(driver_executable_path=path)\n return driver\n\n\nif __name__ == \"__main__\":\n folderchromedriver = \"f:\\\\seleniumdriver3\"\n path = download_undetected_chromedriver(\n folder_path_for_exe=folderchromedriver, undetected=True\n )\n driver = get_driver()\n driver.get(r\"https://demo.guru99.com/test/guru99home/\")\n sleep(4)\n source = get_sourcecode_from_all_frames(\n driver,\n )\n\n \n\t\n```\n\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Get the whole updated HTML source code from every frame (not driver.page_source)",
"version": "0.10",
"split_keywords": [
"selenium",
"frames",
"source",
"html"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "207208d6a87ad8f09d85bcbcdc717c10",
"sha256": "72c8c1b9136ad1c1c19aa406e1a69b350a603b30d013ea71cac896d9c04f6941"
},
"downloads": -1,
"filename": "a_selenium_get_source_from_all_frames-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "207208d6a87ad8f09d85bcbcdc717c10",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 5819,
"upload_time": "2023-01-01T20:49:22",
"upload_time_iso_8601": "2023-01-01T20:49:22.968877Z",
"url": "https://files.pythonhosted.org/packages/64/9b/439fe25518e3a500da59684c9bfa6e77323e554f689e6e2d34b6979c1bf1/a_selenium_get_source_from_all_frames-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "5be5e59f6f9f130c6f1d5e83ddbca791",
"sha256": "e23e83d09827090acfb5c512fd3a71566763033f740ce8bde4fc7943290147d2"
},
"downloads": -1,
"filename": "a_selenium_get_source_from_all_frames-0.10.tar.gz",
"has_sig": false,
"md5_digest": "5be5e59f6f9f130c6f1d5e83ddbca791",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3814,
"upload_time": "2023-01-01T20:49:24",
"upload_time_iso_8601": "2023-01-01T20:49:24.675450Z",
"url": "https://files.pythonhosted.org/packages/47/de/4d028bef8f2a9e60bec8ef9d0d2df56eaedebfebd55f9a6f943db90a3a6e/a_selenium_get_source_from_all_frames-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-01 20:49:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "hansalemaos",
"github_project": "a_selenium_get_source_from_all_frames",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "a_selenium2df",
"specs": []
},
{
"name": "selenium",
"specs": []
}
],
"lcname": "a-selenium-get-source-from-all-frames"
}