def _get_site(self, url, headers, cookies, timeout, driver_args, driver_kwargs):
try:<EOL><INDENT>self.driver.set_page_load_timeout(timeout)<EOL>self.driver.get(url)<EOL>header_data = self.get_selenium_header()<EOL>status_code = header_data['<STR_LIT>']<EOL>self.status_code = status_code<EOL>self.url = self.driver.current_url<EOL><DEDENT>except TimeoutException:<EOL><INDENT>logger.warning("<STR_LIT>".format(url))<EOL>try:<EOL><INDENT>scraper_monitor.failed_url(url, '<STR_LIT>')<EOL><DEDENT>except (NameError, AttributeError):<EOL><INDENT>pass<EOL><DEDENT>except Exception:<EOL><INDENT>logger.exception("<STR_LIT>")<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>raise e.with_traceback(sys.exc_info()[<NUM_LIT:2>])<EOL><DEDENT>else:<EOL><INDENT>if status_code < <NUM_LIT>:<EOL><INDENT>return self.driver.page_source<EOL><DEDENT>else:<EOL><INDENT>raise SeleniumHTTPError("<STR_LIT>", status_code=status_code)<EOL><DEDENT><DEDENT>
Try and return page content in the requested format using selenium