Answers for "webdriver antibot"

0

webdriver antibot

# -*- coding: utf-8 -*-
import time
from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument("--disable-blink-features")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument("user-data-dir=./chromeprofile")
options.add_argument('--disable-extensions')
options.add_argument("--incognito")
options.add_argument("--disable-plugins-discovery")
options.add_argument("--start-maximized")
driver = webdriver.Chrome(f"./chromedriver", options=options)
driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
            "source": """
            Object.defineProperty(navigator, 'webdriver', {
              get: () => undefined
            })
          """
        })#navigator.webdriver = undefined
driver.get('https://bot.sannysoft.com')
time.sleep(225)
driver.quit()
Posted by: Guest on June-05-2021
0

webdriver antibot

driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
     "source": """
          const newProto = navigator.__proto__
          delete newProto.webdriver
          navigator.__proto__ = newProto
          """
    })
Posted by: Guest on June-05-2021
0

webdriver antibot

# -*- coding: utf-8 -*-
import time
from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument("--disable-blink-features")
options.add_experimental_option("excludeSwitches", ["enable-automation"])
options.add_experimental_option('useAutomationExtension', False)
options.add_argument("user-data-dir=./chromeprofile")
options.add_argument('--disable-extensions')
options.add_argument("--incognito")
options.add_argument("--disable-plugins-discovery")
options.add_argument("--start-maximized")
driver = webdriver.Chrome(f"./chromedriver", options=options)
driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
            "source": """
            Object.defineProperty(navigator, 'webdriver', {
              get: () => undefined
            })
          """
        })#navigator.webdriver = undefined
driver.get('https://bot.sannysoft.com')
time.sleep(225)
driver.quit()
Posted by: Guest on June-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language