Home > Mobile >  Simulate human using browser with Python
Simulate human using browser with Python

Time:09-15

I am trying to program a TikTok automation service and have problems logging in automatically.

I am currently using Selenium with the chrome driver and tried just about everything to avoid bot detection from TikTok.

To list a few things: I used the following selenium driver options to avoid detection:

options = webdriver.ChromeOptions()

#options.add_argument("--headless")
options.add_argument("--no-sandbox")
options.add_argument("--window-size=1420,1080")
options.add_argument("--disable-gpu")
options.add_argument(f"user-agent={getRandomUser()}")

options.add_experimental_option("useAutomationExtension", False)  # Adding Argument to Not Use Automation Extension
options.add_experimental_option("excludeSwitches", ["enable-automation"])  # Excluding enable-automation Switch

I used proxies

I generated a random user agent on every request.

Furthermore, I added random delays between all actions.

But nothing helps to overcome the TikTok bot protection.

Is there a way I could fully automate this action with Python on a way deeper level? I am thinking of a script that actually moves my cursor then opens chrome, and types everything out just like a human?

CodePudding user response:

you could use pyautogui for that type of automation

CodePudding user response:

Placing this after each time my python clicks a button or loads a webpage or fills a text box in a form currently works for me. I only do this for pages or popups which prove challenging to navigate.

import time

time.sleep(12)
  • Related