I need to extract exactly the html code of a website that is displayed with F12 on a program python. I tried with requests.get(url) and driver.page_source but I only get the script (devoid of the values I need).
Asked
Active
Viewed 353 times
1
-
Use [tag:selenium]. – Peter Wood May 18 '22 at 09:10
-
Can you use `wget`? – Melon May 18 '22 at 11:03
-
Does this answer your question? [Web-scraping JavaScript page with Python](https://stackoverflow.com/questions/8049520/web-scraping-javascript-page-with-python) – Stephen Ostermiller May 18 '22 at 11:29
1 Answers
0
You are not getting the "actual contents of the webpage" because the JS code needs to run first and the generated content needs to be rendered on the DOM.
Consider this question, the answers should be helpful.

maestromusica
- 706
- 8
- 23