Hey guys,
Every week, it takes me about 2 hours to manually look through the list achievement leaderboards to identify inactive members among our 450+ members. Is there an API that would give us access to this leaderboards information?
If not, I have started trying to do this myself by attempting to scrape the leaderboard webpage – but I haven’t been successful due to having to login to the website. I’m trying to write a python script to login and then retrieve the webpage that contains the leaderboard for my guild. I’m using the python library requests to try to achieve this. However, the login is not successful and when I access the leaderboard for my guild it redirects to the general leaderboard.
Could anyone please help me login to the gw2 website with python-requests?
Here is my code so far:
import requests
EMAIL = ‘my_email’
PASSWORD = ‘my_pw’
URL = ‘https://account.guildwars2.com/login’
session = requests.session()
login_data = dict(email=EMAIL, password=PASSWORD)
r = session.post(URL, data=login_data)
req = session.get(‘https://leaderboards.guildwars2.com/en/na/achievements/guild/Darkhaven%20Elite’)
print req.content