Блог пользователя SadSadBlueMann

Автор SadSadBlueMann, история, 3 года назад, По-английски

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.

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 года назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

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.me/profile/Retired_MiFaFaOvO').url)

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