print('sending request') self.driver.get("http://www.whatsmyip.org/") html_source = self.driver.find_element_by_tag_name( 'html').find_element_by_id('ip').get_attribute('innerHTML') print('got response') print(html_source) end_time = time.time() print('it took ', end_time - start_time) def make_request(self, question): url = self.make_url(question) self.options = Options() self.options.add_argument('--headless') self.options.add_argument('--disable-logging') self.driver = webdriver.Firefox(options=self.options) # self.driver = webdriver.Firefox(options=self.options) try: self.driver.get(url) html_source = self.driver.find_element_by_tag_name( 'html').get_attribute('innerHTML') self.driver.quit() html = BeautifulSoup(html_source, 'html.parser') return html except: return 'Time out' p = Proxy() p.make_proxy_requst()