【问题标题】:How to use undetected_chromedriver.v2 in kali linux如何在 kali linux 中使用 undetected_chromedriver.v2
【发布时间】:2022-01-08 16:00:58
【问题描述】:

如何在kali linux中使用undetected_chromedriver.v2

import undetected_chromedriver.v2 as uc
options = uc.ChromeOptions()

# setting profile
options.user_data_dir = "c:\\temp\\profile"

# another way to set profile is the below (which takes precedence if both variants are used
options.add_argument('--user-data-dir=c:\\temp\\profile2')

# just some options passing in to skip annoying popups
options.add_argument('--no-first-run --no-service-autorun --password-store=basic')
bw = uc.Chrome(options=options, version_main=92) 

【问题讨论】:

  • 如何更改kali linux的路径
  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: selenium jupyter-notebook selenium-chromedriver kali-linux undetected-chromedriver


【解决方案1】:

如果您使用的是,那么使用undetected_chromedriver.v2 您将面临如下错误:

TypeError: __init__() got an unexpected keyword argument 'service'

根据状态是内联的:

2021 年 7 月:目前正忙于为 undetected-chromedriver 实施 selenium 4


但是对于,您仍然可以使用undetected_chromedriver v1,如下所示:

import undetected_chromedriver as uc
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service

options = uc.ChromeOptions() 
options.add_argument("start-maximized")
s = Service('C:\\BrowserDrivers\\chromedriver.exe')
driver = uc.Chrome(service=s, options=options)
driver.get('https://datadome.co/customers-stories/toppreise-ends-web-scraping-and-content-theft-with-datadome/')
driver.save_screenshot('datadome_undetected_webddriver.png')

参考文献

您可以在以下位置找到一些相关的详细讨论:

【讨论】:

    猜你喜欢
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 2021-08-19
    • 2020-11-07
    • 2023-01-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多