'How extract code from web site (code that appears with F12) in python

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).



Solution 1:[1]

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.

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 maestromusica