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
8.79k stars 1.06k forks source link

User Agent issue #146

Closed hchen98 closed 3 years ago

hchen98 commented 3 years ago

Once I use from fake_useragent import UserAgent, the site detects that I am using an automation tool (aka selenium) and redirects me to captcha check. Is there a way for me to add a fake user agent in this lib?

Avnsx commented 3 years ago

@hchen98 There are ways indeed. But all the ones I tried highered detection rates dramatically, so I recommend you not trying to switch UA in first place. Also the repo you mentioned is dogshit, it constantly has outtages, because the used host is down.

You're free to use my code for a list of web Useragents:

import re,requests,random
ua_list = []
userlist=re.sub('\r\n', '\n', str(requests.get('http://pastebin.com/raw/VtUHCwE6').text)).splitlines()
for x in userlist:ua_list.append(x)
random.shuffle(ua_list)
def get_useragent():return(str(random.choice(ua_list)))
pers_UA=get_useragent()
hchen98 commented 3 years ago

@hchen98 There are ways indeed. But all the ones I tried highered detection rates dramatically, so I recommend you not trying to switch UA in first place. Also the repo you mentioned is dogshit, it constantly has outtages, because the used host is down.

You're free to use my code for a list of web Useragents:

import re,requests,random
ua_list = []
userlist=re.sub('\r\n', '\n', str(requests.get('http://pastebin.com/raw/VtUHCwE6').text)).splitlines()
for x in userlist:ua_list.append(x)
random.shuffle(ua_list)
def get_useragent():return(str(random.choice(ua_list)))
pers_UA=get_useragent()

@Avnsx Hey, thanks for replying. Now I see it. Also with this repo, it does not synchronize the latest web driver.