How to fix TikTok selenium robot detection
Background-Info
I'm creating a python selenium bot to do things on the TikTok website. The user will log in manually so the website detecting mouse movement and typing speed is irrelevant.The issue is, is that I can't log in while using selenium
What I've tried
I've tried logging in normally without selenium in incognito mode on chrome with the same Mac address, IP address, and same login details (Which worked!!)
I've tried using random user agents in selenium (Which didn't Work)
I've tried adding the following chrome options
options.add_argument("start-maximized")
# Chrome is controlled by automated test software
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
# avoiding detection
options.add_argument('--disable-blink-features=AutomationControlled')
What I want
I want to be able to log in without TikTok saying Too many log-in attempts. Try again later and for more clarification, I can log in normally without selenium same everything and it works it just doesn't work while in selenium.
Heres is the code for starting selenium
post = "https://www.tiktok.com/@smoothmovesranch/video/7091224442243681579"
myProxy = ""
#configuration
options = Options()
prox = Proxy()
prox.proxy_type = ProxyType.MANUAL
prox.http_proxy = myProxy
prox.ssl_proxy = myProxy
capabilities = webdriver.DesiredCapabilities.CHROME
prox.add_to_capabilities(capabilities)
options.add_argument("window-size=1400,600")
options.add_argument("--incognito")
driver = webdriver.Chrome(executable_path = os.path.join(os.getcwd(), 'chromedriver'), options=options)
#opens tiktok login page
driver.get('https://www.tiktok.com/login/phone-or-email/email')