Last active
February 16, 2022 11:52
-
-
Save cmin764/ff7a76aa370f44962400f42329a6cf25 to your computer and use it in GitHub Desktop.
Extends Selenium with automatic downloading support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from RPA.Browser.Selenium import Selenium | |
| from SeleniumLibrary.base import keyword | |
| from selenium import webdriver | |
| class ExtendedSelenium(Selenium): | |
| @keyword | |
| def open_site(self, url, **kwargs): | |
| options = webdriver.ChromeOptions() | |
| prefs = {'profile.default_content_setting_values.automatic_downloads': 1} | |
| options.add_experimental_option("prefs", prefs) | |
| self.open_browser( | |
| url=url, | |
| options=options, | |
| **kwargs | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment