While I am aware that Firefox profiles can be used to disable JavaScript, like in this example on Selenium WebDriver, I have come across a scenario where I need JavaScript enabled for logging into a page, but disabled once logged in. This way, when I use page_source
, it will return the DOM without any JavaScript effects. The challenge here is that the login page specifically requires JavaScript. Is there a way to dynamically control JavaScript enablement using Selenium WebDriver?