【问题标题】:Selenium using different proxy for every tabSelenium 为每个选项卡使用不同的代理
【发布时间】:2022-06-28 23:39:27
【问题描述】:

我想为我在 selenium 驱动程序中打开的每个选项卡使用不同的代理。 在python中。

示例(解释我想做什么):

import undetected_chromedriver as uc
browser = uc.Chrome()
browser.get("https://stackoverflow.com") # First tab without proxy

# Opening the second tab

browser.execute_script("window.open('about:blank', 'tab2');")
browser.switch_to.window("tab2")
browser.get("http://google.com", proxy) # Second tab with proxy

我需要帮助才能知道如何做到这一点。感谢您的帮助。

【问题讨论】:

    标签: python selenium undetected-chromedriver


    【解决方案1】:

    到目前为止,Chrome 或 Firefox 的 API 不支持,您最好的选择是为每个 chrome 窗口使用不同的代理

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-06
      • 2019-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多