9

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

1
  • Welcome to SO. Just add this below line and see. options.add_argument("javascript.enabled", True) Commented Apr 2, 2019 at 18:16

2 Answers 2

22

answers provided here won't work. instead, use

options.add_argument("--enable-javascript")
Sign up to request clarification or add additional context in comments.

2 Comments

In the meantime, chrome_options has been deprecated. The parameter is now called just options.
This option doesn't work for me, any other solution
-1

As supputuri mentioned, add the following chrome option to your argument:

options.add_argument("javascript.enabled", True)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.