'Python Web Scraping view contents of driver
I'm using Python \ Selenium \ Chrome web drivers to perform web scraping in Visual Studio Code.
If I send a GET i.e.:
driver.get('https://my_test_website/customerRest/show/?id=123')
How do I actually view the contents of the reply? If I run the URL in Chrome, I can view all the data in one huge body:
How do I view it in Python? I ultimately want to insert it into a SQL table but the 1st step is to view via Python.
Any help would be greatly appreciated.
Solution 1:[1]
To view the contents of the <body> tag you need to use the page_source property.
page_source: Gets the source of the current page.
Usage:
driver.page_source
To print the contents within the console:
print(driver.page_source)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | undetected Selenium |

