Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
script to get players elo using paladins-tracker.de
import requests
from bs4 import BeautifulSoup as BS
from multiprocessing.dummy import Pool
def get_elo(nickname):
sess=requests.Session()
r=sess.get(f"https://paladins-tracker.de/search/player/{nickname}")
soup=BS(r.text,"html.parser")
link=soup.select_one(".player-meta.clearfix a")
if link==None:
return None
r=sess.get(f"https://paladins-tracker.de{link.attrs['href']}")
soup=BS(r.text,"html.parser")
elo=soup.select_one(".player-meta.clearfix .ranked-name")
if elo==None:
return None
return elo.text
nicks="""
mittow
kamivs
""".strip().split("\n")
for nick,ello in Pool(len(nicks)).imap(lambda nick:(nick,get_elo(nick)),nicks):
print(nick,ello)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment