Python Selenium Chrome Disable Pop Up Blocker

﹥>﹥吖頭↗ 提交于 2019-12-09 23:43:38

问题


For some reason I can not figure out how to disable the pop up blocker (to allow pop up windows to work). This use to work, so I am guessing it has something to do with the new version of Chrome/Chromedriver? Below is some sample code, that I know use to work, but now when a pop up happens, I do not even see the icon in the top right, where you can allow the pop up or not. I did also try using the prefs found here to disable the pop up blocker, but that did not work ether. If anyone has a solution, it would be much appreciated!

from selenium import webdriver  
from selenium.webdriver.chrome.options import Options

request_url = 'https://www.example.com'

chrome_options = Options()
chrome_options.add_argument("--disable-popup-blocking")

driver = webdriver.Chrome(chrome_options=chrome_options)
driver.get(request_url)

来源:https://stackoverflow.com/questions/47817665/python-selenium-chrome-disable-pop-up-blocker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!