Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it randomly fails to scrape AtCoder #232

Closed
kmyk opened this issue Jan 2, 2019 · 3 comments
Closed

it randomly fails to scrape AtCoder #232

kmyk opened this issue Jan 2, 2019 · 3 comments

Comments

@kmyk
Copy link
Member

kmyk commented Jan 2, 2019

たぶん鯖側のキャッシュの関係でしょう。betaから取る用に変更すれば直るはず

$ ./oj -v g/s https://beta.atcoder.jp/contests/arc083/tasks/arc083_a
[DEBUG] args: Namespace(cookie=PosixPath('/home/user/.local/share/online-judge-tools/cookie.jar'), repeat_macro=None, scanf=False, silent=False, subcommand='g/s', url='https://beta.atcoder.jp/contests/arc083/tasks/arc083_a', verbose=True)
[!] This feature is experimental.
[x] problem recognized: <onlinejudge.service.atcoder.AtCoderProblem object at 0x7fd846926438>: https://beta.atcoder.jp/contests/arc083/tasks/arc083_a
[x] load cookie from: /home/user/.local/share/online-judge-tools/cookie.jar
[x] GET: http://arc083.contest.atcoder.jp/tasks/arc083_a
[x] 200 OK
[DEBUG] cookie: <Cookie __passport=VkITwvpHHRhp-U2GRqjgNA for .arc083.contest.atcoder.jp/>
[DEBUG] cookie: <Cookie __privilege=guest for .arc083.contest.atcoder.jp/>
[DEBUG] cookie: <Cookie _kick_id=2012-04-25+04%3A51 for .atcoder.jp/>
[x] save cookie to: /home/user/.local/share/online-judge-tools/cookie.jar
[DEBUG] original data: 'A B C D E F\r\n'
[DEBUG] tokenized: [[{'kind': 'fixed', 'name': 'A'}, {'kind': 'fixed', 'name': 'B'}, {'kind': 'fixed', 'name': 'C'}, {'kind': 'fixed', 'name': 'D'}, {'kind': 'fixed', 'name': 'E'}, {'kind': 'fixed', 'name': 'F'}]]
[DEBUG] parsed: [{'kind': 'decl', 'names': ['A']}, {'kind': 'read', 'names': ['A']}, {'kind': 'decl', 'names': ['B']}, {'kind': 'read', 'names': ['B']}, {'kind': 'decl', 'names': ['C']}, {'kind': 'read', 'names': ['C']}, {'kind': 'decl', 'names': ['D']}, {'kind': 'read', 'names': ['D']}, {'kind': 'decl', 'names': ['E']}, {'kind': 'read', 'names': ['E']}, {'kind': 'decl', 'names': ['F']}, {'kind': 'read', 'names': ['F']}]
[DEBUG] postprocessed: [{'kind': 'decl', 'names': ['A', 'B', 'C', 'D', 'E', 'F']}, {'kind': 'read', 'names': ['A', 'B', 'C', 'D', 'E', 'F']}]
[DEBUG] result: 'int A, B, C, D, E, F; cin >> A >> B >> C >> D >> E >> F;\n'
[+] success:
int A, B, C, D, E, F; cin >> A >> B >> C >> D >> E >> F;
$ ./oj -v g/s https://beta.atcoder.jp/contests/arc083/tasks/arc083_a
[DEBUG] args: Namespace(cookie=PosixPath('/home/user/.local/share/online-judge-tools/cookie.jar'), repeat_macro=None, scanf=False, silent=False, subcommand='g/s', url='https://beta.atcoder.jp/contests/arc083/tasks/arc083_a', verbose=True)
[!] This feature is experimental.
[x] problem recognized: <onlinejudge.service.atcoder.AtCoderProblem object at 0x7f56444095c0>: https://beta.atcoder.jp/contests/arc083/tasks/arc083_a
[x] load cookie from: /home/user/.local/share/online-judge-tools/cookie.jar
[x] GET: http://arc083.contest.atcoder.jp/tasks/arc083_a
[x] 200 OK
[DEBUG] cookie: <Cookie _kick_id=2012-04-25+04%3A51 for .atcoder.jp/>
[x] save cookie to: /home/user/.local/share/online-judge-tools/cookie.jar
[ERROR] input format not found
@kmyk kmyk changed the title it randomly fails to scraping AtCoder it randomly fails to scrape AtCoder Jan 2, 2019
@kmyk
Copy link
Member Author

kmyk commented Jan 2, 2019

英語力

@kmyk
Copy link
Member Author

kmyk commented Jan 2, 2019

Content-Type: text/html; charset=utf-8Content-Type: text/html が混在してるね

kmyk added a commit that referenced this issue Jan 2, 2019
@kmyk
Copy link
Member Author

kmyk commented Jan 2, 2019

直した

@kmyk kmyk closed this as completed Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant