Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×
Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

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

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

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
  • Проголосовать: не нравится

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

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

»
2 года назад, # |
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.com/profile/Retired_MiFaFaOvO').url)

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