def get_best(url):
url = 'http://www.infoarena.ro' + url
source_code = requests.get(url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text, "html.parser")
name = soup.find('span', {'class': 'username'}).find('a')['href'][35:]
tests = soup.find_all('td', {'class': 'number'})
max_ms = -1
for test in tests:
test = test.string
if test.endswith('ms'):
time = int(test.strip('ms'))
max_ms = max(max_ms, time)
if name not in d or max_ms < d[name][0]:
d[name] = (max_ms, url)
print(max_ms, name, url)
评论列表
文章目录