Is there a way to scrape problem statements automatically?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3831 |
3 | Radewoosh | 3646 |
4 | jqdai0815 | 3620 |
4 | Benq | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | gamegame | 3386 |
10 | ksun48 | 3373 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
5 | -is-this-fft- | 158 |
6 | awoo | 157 |
7 | adamant | 156 |
8 | TheScrasse | 154 |
8 | nor | 154 |
10 | Dominater069 | 153 |
Is there a way to scrape problem statements automatically?
Название |
---|
Using codeforces API — checkout the
Problem
section.Unfortunately, the Problem object does not come with the statement text.
I am not sure what you are trying to achieve but previously I was working on a similar kind of problem I used
beautifulsoup
from python to read HTML and parse the content. you can do a similar for your purpose.I tried using soup but it doesn't work anymore. I think Codeforces upgraded their systems (currently uses some sort of script to get statements on demand? I know very little about this stuff). In fact, previously you could just use
wget
to just download a problem page, likehttps://codeforces.net/problemset/problem/1673/F
, to get the raw HTML. This doesn't work anymore. In case I might be missing something trivial, could you please try using soup again – I mean, right now? I think when you did your parsing, a simplewget
command would've worked.Download page using the problem id?
So, a friend of mine looked into it and found out that
wget/curl https://codeforces.net/contest/contestId/problems
still works, while the problem withwget/curl https://codeforces.net/problemset/problem/contestId/index
is that it just gives the preload HTML. So, scraping contest psets instead of individual problems is an alternative. Thanks for your comments.Unfortunately, it seems like this no longer work anymore :/ Did you manage to find any other alternative?