'Login to FedEx with Python / Selenium (Chrome)

I'm trying to login to FedEx's website and after I enter the credentials I get the following error message:

Access to www.fedex.com was denied you don't have the authorization to view this page. HTTP ERROR 403

Image: Included

My credentials are valid and work if I log in normally. I also notice that I get a info bar stating "Chrome is being controlled by automated test software". Is this possibly because of bot detection? Is there a way around this? Any help is much appreciated.

Code:

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
import time

username = "ACCOUNT_INFO"
password = "ACCOUNT_INFO"

driver = webdriver.Chrome("C:\Program Files\ChromeDriver\chromedriver.exe")
driver.get("https://www.fedex.com/fcl/?appName=fclfsm&locale=us_en&step3URL=https%3A%2F%2Fwww.fedex.com%2Fshipping%2FshipEntryAction.do%3Fmethod%3DdoRegistration%26link%3D1%26locale%3Den_US%26urlparams%3Dus%26sType%3DF&returnurl=https%3A%2F%2Fwww.fedex.com%2Fshipping%2FshipEntryAction.do%3Fmethod%3DdoEntry%26link%3D1%26locale%3Den_US%26urlparams%3Dus%26sType%3DF&programIndicator=0")

username_textbox = driver.find_element_by_name("username")
username_textbox.send_keys(username)
time.sleep(5)

password_textbox = driver.find_element_by_name("password")
password_textbox.send_keys(password)
time.sleep(5)

login_button = driver.find_element_by_name("login")
login_button.submit()

I have tried different web broswers such as Chrome and Edge. I was able to do this in IE but IE will no longer be supported and also features do not work for FedEx's website in IE now since the latest update.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source