I try to get HTML code of the page, but driver.page_source always return HTML + JavaScript.
I know it is many ways described earlier, but in my case they don't work.
The page is - https://qe.com.qa/en/companymoreinformationsearch?CompanyCode=QNBK
To extract the HTML along with the JavaScript you need to induce WebDriverWait for the visibility_of_all_elements_located() with id as
moreinfo-headingand you can use the following Locator Strategy:Code Block:
Using
driver.page_source:As an alternative, you can also use document.documentElement.outerHTML and document.documentElement.innerHTML as follows:
Using
document.documentElement.outerHTML:Using
document.documentElement.innerHTML:Console Output: