How To Close Chrome Browser Popup Dialog Using Selenium Webdriver And Python
I have a python code that uses selenium webdriver (along with chromedriver), to log into facebook and take a screenshot of the page. the script itself works as expected, however, a
Solution 1:
in Python you can use
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--disable-notifications")
webdriver.Chrome(os.path.join(path, 'chromedriver'),
chrome_options=chrome_options)
Solution 2:
You can try with launching the chrome browser with disabled pop-ups (browser pop-ups). The following code snippet is in Java. It will be somewhat similar in python i believe.
ChromeOptionsoptions=newChromeOptions();
options.addArguments("--disable-popup-blocking");
options.addArguments("test-type");
ChromeDriverdriver=newChromeDriver(options);
Baca Juga
- Selenium.common.exceptions.webdriverexception: Message: Invalid Argument: Value Must Be A Non-negative Integer With Chromedriver And Selenium
- Failed-path Too Long Error After Downloading Csv File Using Chromedriver And Chrome Browser Launched By Selenium Through Cygwin In Python
- Typeerror: 'module' Object Is Not Callable Error With Driver=webdriver("c:\\python34\\lib\\site-packages\\selenium\\webdriver\\chromedriver.exe")
Post a Comment for "How To Close Chrome Browser Popup Dialog Using Selenium Webdriver And Python"