【发布时间】:2022-09-22 21:52:57
【问题描述】:
我试图在 python 中使用未检测到的 chrome 驱动程序打开另一个选项卡。我发现当我使用 javascript 方式时,chrome 会阻止我的弹出窗口。我无法弄清楚我做错了什么。这是我的代码。
options = webdriver.ChromeOptions()
options.add_argument(\'--disable-popup-blocking\')
if __name__ == \'__main__\':
chrome = uc.Chrome(options=options)
time.sleep(1)
chrome.get(\"https://www.google.com\")
chrome.execute_script(\"window.open(\'https://google.com\',\'_blank\')\")
标签: python selenium selenium-chromedriver undetected-chromedriver