def get_result_by_url(self, url): result = Result() try: with request.urlopen(url) as fin: data = fin.read().decode(self.code_type) soup = BeautifulSoup(data, 'lxml') line = soup.find('table', attrs={'id': 'result-tab'}).find('tr', attrs={'class': 'evenrow'}).find_all( 'td') if line is not None: result.origin_run_id = line[0].string result.verdict = line[4].string result.execute_time = line[6].string result.execute_memory = line[5].string finally: return result
def get_result_by_url(self, url): result = Result() try: data = self.req.get(url) self.cookies = data.cookies soup = BeautifulSoup(data.text, 'lxml') line = soup.find('table', attrs={'class': 'table_text'}).find('tr', attrs={'align': 'center'}).find_all( 'td') if line: result.origin_run_id = line[0].string result.verdict = line[2].string result.execute_time = line[4].string result.execute_memory = line[5].string return result except: pass return result
def get_result_by_url(self, url): result = Result() try: data = self.req.get(url) data = BeautifulSoup(data.text, 'lxml') line = data.find_all('td', attrs={}) if line: result.origin_run_id = line[0].get_text().strip().replace( '\n', '') result.verdict = line[4].get_text().strip().replace('\n', '') result.execute_time = line[5].get_text().strip().replace( '\n', '') result.execute_memory = line[6].get_text().strip().replace( '\n', '') return result except: pass return result
def get_result_by_url(self, url): result = Result() try: with request.urlopen(url) as fin: data = fin.read().decode(self.code_type) soup = BeautifulSoup(data, 'lxml') line = soup.find('table').find('tr', attrs={ 'onmouseover': 'hl(this);' }).find_all('td') if line is not None: result.origin_run_id = line[0].string result.verdict = line[2].string result.execute_time = line[5].string result.execute_memory = line[6].string return result except: pass return result
def get_result_by_url(self, url): result = Result() try: res = self.req.get(url) soup = BeautifulSoup(res.text, 'lxml') line = soup.find('table', attrs={ 'id': 'result-tab' }).find('tr', attrs={ 'class': 'evenrow' }).find_all('td') if line is not None: result.origin_run_id = line[0].string result.verdict = line[4].string result.execute_time = line[6].string result.execute_memory = line[5].string return result except: pass return None