SadSadBlueMann's blog

By SadSadBlueMann, history, 2 years ago, In English

Hi!

I'm trying to write a python script to extract certain users from a contest's standings(Hello 2022 in this case), but most of the time I get an error because some people have changed their handle ever since that contest. I am combining contest.standings and user.info methods to extract the users that satisfy the given conditions. are there any other routes to achieve this goal or am I doing something wrong?

EDIT : in this case(Hello 2022), the user MiracleFaFa has changed their handle from Retired_MiFaFaOvO to MiracleFaFa.

  • Vote: I like it
  • +1
  • Vote: I do not like it

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by SadSadBlueMann (previous revision, new revision, compare).

»
2 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

You can try using the fact that codeforces redirects links corresponding to previous handles to the links corresponding to new handles.

import requests
print(requests.get('https://codeforces.com/profile/Retired_MiFaFaOvO').url)

This will give https://codeforces.com/profile/MiracleFaFa. Use it to extract new handles