我正在使用硒,但是当我使用驱动程序时。

发布于 2025-02-02 14:59:56 字数 753 浏览 3 评论 0原文

我使用Selenium在Python中创建了一个机器人,将Ununtu上传到远程服务器,当我转到驱动程序时。站点,发生访问拒绝错误。在Windows上,一切正常(代码正在工作)。

    chrome_options = Options()
    chrome_options.add_argument('--headless')
    chrome_options.add_argument('--no-sandbox')
    chrome_options.add_argument('--disable-dev-shm-usage')
    chrome_options.add_argument('--disable-blink-features=AutomationControlled')
    chrome_options.add_argument('--enable-experimental-cookie-features')

    driver = webdriver.Chrome(service=Service(browser_driver_path), chrome_options=chrome_options)
    driver.get(website_link)

已经尝试过:使用Undetected_chromedriver。我还从Internet执行了基本操作,打开了Cookie,清除了缓存等。

库:

  • Selenium
  • PyvirtualDisplay
  • WebDraver选项

I created a bot in Python using Selenium, uploaded Ununtu to a remote server, and when I go to the driver.get('correct_url') => site, an access denied error occurs. On windows everything works fine (code is working).

    chrome_options = Options()
    chrome_options.add_argument('--headless')
    chrome_options.add_argument('--no-sandbox')
    chrome_options.add_argument('--disable-dev-shm-usage')
    chrome_options.add_argument('--disable-blink-features=AutomationControlled')
    chrome_options.add_argument('--enable-experimental-cookie-features')

    driver = webdriver.Chrome(service=Service(browser_driver_path), chrome_options=chrome_options)
    driver.get(website_link)

Already tried: to use undetected_chromedriver. I also performed basic actions from the Internet, turned on cookies, cleared the cache, etc.

Libraries:

  • selenium
  • pyvirtualdisplay
  • webdriver Options

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文