ultrafunkamsterdam / undetected-chromedriver

Custom Selenium Chromedriver | Zero-Config | Passes ALL bot mitigation systems (like Distil / Imperva/ Datadadome / CloudFlare IUAM)
https://github.com/UltrafunkAmsterdam/undetected-chromedriver
GNU General Public License v3.0
9.76k stars 1.15k forks source link

chrome driver is detected after some test ! #584

Closed Beeriswater closed 2 years ago

Beeriswater commented 2 years ago

Hi, I’m trying to log into booking.com with the chrome driver. 10 tests manage to log in, the next not, as if the site recognizes the device id or the chrome driver saves something?

If you need some specific info or the code, I can provide it. Thank you!

I'm on MacOS and using chrome 100.

QIN2DIM commented 2 years ago

I tried using random User Agent

remove this

Beeriswater commented 2 years ago

Thanks for your reply. Driver is detected even without using random User Agent

Beeriswater commented 2 years ago

Does anyone know how to fix this problem? @ultrafunkamsterdam @sebdelsol

nate-bush commented 2 years ago

@Beeriswater Please share your code, and undetected-chromedriver version.

Beeriswater commented 2 years ago
import pickle
import time
from tkinter import Button
from unittest import result
from requests import session
from selenium import webdriver
import undetected_chromedriver as uc
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from fake_useragent import UserAgent

driver = uc.Chrome(use_subprocess=True)
driver.get("https://admin.booking.com")
time.sleep(2)

usernameField = driver.find_element_by_id("loginname")
usernameField.send_keys("1234567")
usernameField.send_keys(Keys.RETURN)
time.sleep(3)
passwordField = driver.find_element_by_id("password")
passwordField.send_keys("sample") #incorrect password
passwordField.send_keys(Keys.RETURN)
time.sleep(10)

@nate-bush this is the code i'm using. If you open the website on a normal browser and try to log in, you will notice that they don't ask you to press and hold (robot verification as seen in the photo).

Screenshot 2022-04-16 at 11 47 23
sebdelsol commented 2 years ago

You are rate limited and now your IP is probably flagged as suspicious.

You try to login 10 times in row which is as obvious as screaming "I'm a bot!!". You are fortunate this site is lax enough not to ban you for some duration.

Anyway this site has an API here that would save you a lot of hassle.

@QIN2DIM is right, you've to be careful when spoofing your user agent because it's really easy to detect : by having an user agent incompatible with your OS or the one detected by simple javascript fingerprint techniques. It's even more suspicious when you frequently change your user agent but keep the same IP and or account.

Beeriswater commented 2 years ago

@sebdelsol thank you very much for your reply. The problem is that their API is not public. I tried loading the cookies but nothing changed. Is there a way to change the IP at each run ?

sebdelsol commented 2 years ago

Yes you can use proxies (aka spoof your IP), please check here.

What's hard to find are good ones : a lot are quickly abused then flagged as suspicious IPs. Unfortunately I can't help you with that : it's a greyish industry that I don't know.

Anyway please bear in mind that you shouldn't use different IPs with the same account since it'd look like you're jumping from one geographic location to another in no time and that would be so weird your account would be quickly flagged (hey, actual humans don't teleport : that's an easy rule to enforce server-side).

EDIT: you're right, to get an API key you need to own an actual running website...