【问题标题】:Why does gog.com not load properly in chromedriver为什么 gog.com 无法在 chromedriver 中正确加载
【发布时间】:2021-12-03 13:00:43
【问题描述】:

下图显示了 gog.com 在 google chrome(左)和 chromedriver(右)上的显示方式。为什么它不能正确加载到 chromedriver 上?

在 chromedriver 中,一切似乎都严重不成比例并且损坏了。我也发现 2 个 html 没有区别,这不是由于游戏的价格或名称(无论如何都是随机选择的。)

我的 chromedriver 脚本实际上就是:

driver_xpath2 = "chromedriver.exe"
driver = webdriver.Chrome(driver_xpath2)
driver.get("https://www.gog.com/")
  1. 为什么 chromedriver 创建这个看起来与 chrome 不同的页面?

  2. 我一直在读到,不可能检测到有人在使用 chromedriver 而不仅仅是 chrome。真的吗? (除了监控计算机上的常规事件和用户行为模式)

【问题讨论】:

    标签: html selenium google-chrome selenium-chromedriver


    【解决方案1】:

    首先尝试使用最新的chrome驱动版本here

    如果您已经在使用最新版本,为了解决我建议使用左侧屏幕截图中您正在使用的 Chrome 配置文件的问题。

    要加载它,只需使用:

    service = Service('path\\to\\chromedriver.exe') # your driver path
    
    chrome_options = Options()
    chrome_options.add_argument \
        (r"--user-data-dir=C:\\Users\\your_user\\AppData\\Local\\Google\\Chrome\\User Data") # your chrome user data directory
    chrome_options.add_argument(r'--profile-directory=Default') # the profile you need
    driver = webdriver.Chrome(service=service, options=chrome_options)
    

    上面的代码还以更优雅的方式添加了chrome驱动.exe

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-04
      • 2017-12-14
      • 1970-01-01
      相关资源
      最近更新 更多