def set_selenium_local_session(self, Settings): self.browser, err_msg = set_selenium_local_session( self.proxy_address, self.proxy_address, self.proxy_chrome_extension, self.headless_browser, self.use_firefox, self.browser_profile_path, self.disable_image_load, self.page_delay, self.logger, Settings, ) if len(err_msg) > 0: raise SocialPyError(err_msg)
def set_selenium_local_session(self, Settings): self.browser, err_msg = \ set_selenium_local_session(None, None, None, self.headless_browser, self.use_firefox, self.browser_profile_path, # Replaces # browser User # Agent from # "HeadlessChrome". self.disable_image_load, self.page_delay, self.logger, Settings) if len(err_msg) > 0: raise SocialPyError(err_msg)
console_handler.setFormatter(logger_formatter) logger.addHandler(console_handler) logger = logging.LoggerAdapter(logger, extra) return logger url = 'https://protonmail.com/' # driver = webdriver.Chrome('/Users/johnfisher/Downloads/chromedriver') logger = get_logger() driver, err_msg = set_selenium_local_session( None, None, None, False, False, None, True, 25, logger, Settings, ) print(err_msg) if len(err_msg) > 0: raise SocialPyError(err_msg) driver.get(url) driver.find_element_by_xpath('//*[@title="SIGN UP"]').click()