C
C
cloneforce2020-10-22 07:27:35
Python
cloneforce, 2020-10-22 07:27:35

How to replace browser fingerprints with Python Selenium?

Good afternoon
I've been scratching my head for two days now.
How to change browser fingerprints in Python Selenium chromedriver?
What I want to replace when opening a browser is:

User agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
Window size : 1366*657
Resolution : 1366 *728
Plugin list : Chrome PDF Plugin and 2 others
Mime types : application/pdf and 3 others
Font list : Arial and 114 others
Header order : Host, X-Real-Ip, X-Forwarded-For and others
Session storage : Yes
Local storage : Yes
Indexed DB: Yes
Web Sql : Yes
Video card manufacturer : Google Inc.
Video card model : ANGLE (Intel(R) HD Graphics 3000 Direct3D9Ex vs_3_0 ps_3_0)
Audio card frequency : 48000
Audio card latency : 0.01

Fingerprint itself: https://pastebin.com/3u6cEX0L

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2020-10-22
@cloneforce

Well, something like this:

from fake_useragent import UserAgent
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

opts = Options()
ua = UserAgent()

some_width = 1024
some_height = 1024

opts.add_argument(f"user-agent={ua.chrome}")
opts.add_argument(f"--width={some_width}")
opts.add_argument(f"--height={some_height}")
...
driver = webdriver.Chrome(chrome_options=opts)

Or by creating custom profiles for the browser, and slipping them:
opts.add_argument("user-data-dir=/путь до кастомного профайла")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question