How to enable javascript in selenium webdriver Chrome using python
16,384
answers provided here won't work. instead, use
options.add_argument("--enable-javascript")
Author by
Admin
Updated on June 30, 2022Comments
-
Admin almost 2 years
I am trying to open https://www.guidestar.org/ using selenium webdriver but it is able to detect I am a bot. The email I received says that javascript was not enabled so they were blocking my IP address. Can anyone suggest a code to enable javascripts
user_agent = 'Chrome/73.0.3683.86' username = os.getenv("USERNAME") userProfile = "C:\\Users\\" + username + "\\AppData\\Local\\Google\\Chrome\\User Data\\Default" options = webdriver.ChromeOptions() options.add_argument(f'user-agent={user_agent}') options.add_argument("user-data-dir={}".format(userProfile)) driver = webdriver.Chrome(chrome_options=options) driver.get("http://www.guidestar.org")
I expected the website not to detect that I am a robot