Skip to content

Instantly share code, notes, and snippets.

@cmin764
Last active February 16, 2022 11:52
Show Gist options
  • Select an option

  • Save cmin764/ff7a76aa370f44962400f42329a6cf25 to your computer and use it in GitHub Desktop.

Select an option

Save cmin764/ff7a76aa370f44962400f42329a6cf25 to your computer and use it in GitHub Desktop.
Extends Selenium with automatic downloading support
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