Need VBA + Selenium expert. WEbsite blocking selenium
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x


I'm trying to access with chrome webdriver in VBA but it's blocking it.

This is the code:
dim ChromeWeb As New WebDriver
ChromeWeb.Start "chrome", ""

ChromeWeb.Get "/"

ChromeWeb.FindElementByName("user").SendKeys "myusername"
ChromeWeb.FindElementByName("pwd").SendKeys "mypass"
ChromeWeb.FindElementByXPath("/html/body/div[2]/header/div/div/nav/div/div/div/div[1]/div/div/form/button").Click blocks selenium with this message "Sorry. Something went wrong. Please re-enter your user name and password to try again." (if you log in in a normal chrome and you put an incorrect user/password, it will display "Login incorrect. Either the user ID or password combination is incorrect or the account has been locked. Please try again or click here to recover your password."

tried to make it headless and other stuff but did not work. I need someone more experienced than me with selenium, to achieve log in on and control over it.


awarded to rmi

Crowdsource coding tasks.

1 Solution

Winning solution


adding this line to your VBA script will prevent the website from detecting Selenium:

ChromeWeb.AddArgument "--disable-blink-features=AutomationControlled"

Insert it before the ChromeWeb.Start line.

I just tried this and FedEx no longer returned 403 error code when trying to login.

Let me know if this works for you, thanks!

Thanks! I tried with the argument above: ChromeWeb.AddArgument "--disable-blink-features=AutomationControlled" ChromeWeb.Start "chrome", "" ChromeWeb.Window.Maximize ChromeWeb.Get "" ChromeWeb.FindElementByName("username").SendKeys "123" ChromeWeb.FindElementByName("password").SendKeys "123" ChromeWeb.FindElementByXPath("/html/body/div/div[2]/div/form/table/tbody/tr[6]/td/div/table/tbody/tr/td[1]/div/div[2]/table/tbody/tr[6]/td/table/tbody/tr/td[3]/input").Click It's still taking me to a 403 error page and does not allow me to proceed. Any other ideas?
Fred 3 months ago
Here's the code that works for me. I'm using different URL which contains only the login form. Could you try this?
rmi 3 months ago
Thanks, please read comment on github so I can close this work and pay you the bounty. thanks.
Fred 3 months ago