
Selenium Chrome के लिए स्टील्थ परत जो ब्राउज़र फ़िंगरप्रिंट और ऑटोमेशन सिग्नल को बदलकर बॉट डिटेक्शन से बचने और reCAPTCHA v3 स्कोर बनाए रखने में सहायता करती है।
पहचान (detection) रोकने के लिए एक python package selenium-stealth। यह प्रोग्राम python selenium को और अधिक stealthy बनाने की कोशिश कर रहा है।
अभी तक selenium-stealth only Selenium Chrome/Chromium को support करता है।
selenium-stealth का उपयोग करने के बाद आप लगभग सभी selenium detections को रोक सकते हैं। Stackoverflow पर selenium detection को कैसे रोका जाए इस पर बहुत सारे guides हैं लेकिन मुझे इसके लिए एक भी python package नहीं मिला इसलिए मैं इसे बना रहा हूँ, आखिरकार हम cats को जीत नहीं सकते। इसे JavaScript puppeteer-extra-plugin-stealth के re-implementation के रूप में देखा जा सकता है जिसे @berstend ने विकसित किया है।
Features जो वर्तमान में selenium-stealth प्रदान कर सकता है:
✅️ selenium-stealth stealth के साथ सभी public bot tests पास करता है।
✅️ selenium-stealth के साथ selenium google account login कर सकता है।
✅️ selenium-stealth सामान्य reCAPTCHA v3 score बनाए रखने में मदद करता है
अगर आपको यह package उपयोगी लगता है और आप इसके निरंतर development का समर्थन करना चाहते हैं, तो आप यहाँ donate कर सकते हैं। आपके समर्थन के लिए धन्यवाद।
Selenium-stealth PyPI पर उपलब्ध है, आप इसे pip से install कर सकते हैं।
$ pip install selenium-stealth
from selenium import webdriver
from selenium_stealth import stealth
import time
options = webdriver.ChromeOptions()
options.add_argument("start-maximized")
# options.add_argument("--headless")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=options, executable_path=r"C:\Users\DIPRAJ\Programming\adclick_bot\chromedriver.exe")
stealth(driver,
languages=["en-US", "en"],
vendor="Google Inc.",
platform="Win32",
webgl_vendor="Intel Inc.",
renderer="Intel Iris OpenGL Engine",
fix_hairline=True,
)
url = "https://bot.sannysoft.com/"
driver.get(url)
time.sleep(5)
driver.quit()
stealth(
driver: Driver,
user_agent: str = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.53 Safari/537.36',
languages: [str] = ["en-US", "en"],
vendor: str = "Google Inc.",
platform: str = "Win32",
webgl_vendor: str = "Intel Inc.",
renderer: str = "Intel Iris OpenGL Engine",
fix_hairline: bool = False,
run_on_insecure_origins: bool = False,
)
headless |
headful |
headless |
headful |
Copyright © 2020, diprajpatra. Released under the MIT License.