Forum Discussion

gautamalok's avatar
1 year ago

Why is getting page source using Python + Selenium not working, association declined?

Hi Everyone, 

I'm using Selenium with Python to get the page source, but it's not working. My code is as follows:

from selenium import webdriver browser = webdriver.Firefox() browser.get('https://python.org') html_source = browser.page_source print(html_source)

When I run this, the browser opens, but nothing happens. After about 15 seconds, I get an error saying, "Association declined." If I try accessing the site manually, it also doesn't load.

Why is this happening? My code seems correct, and I need to get the page source after JavaScript execution. Does Selenium handle this, or is there another way to achieve it?

Thanks,
Alok

No RepliesBe the first to reply