2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AtCoderのテストケースをDropboxからスクレイピング

Last updated at Posted at 2021-10-31

atcoder過去問のテストケースはDropboxに保存されていて,Dropboxの仕様上一部のテストケースを一括ダウンロードできないことが知られている↓
https://ut0s.netlify.app/2019/08/atcoder-testcase-downloader/

以下のコードを実行すると,Wolfram言語でABC問題のテストケースを一括ダウンロードします.

###コード(仮)

session = StartWebSession[];
WebExecute["OpenPage"->"https://www.dropbox.com/sh/arnpe0ef5wds8cv/AAAk_SECQ2Nc6SVGii3rHX6Fa?dl=0"];
links = WebExecute["PageHyperlinks"];
abcProblems = Select[StringContainsQ[#, "/ABC" | "/abc"] &]@links;
Function[link,
  WebExecute["OpenPage" -> link];
  WebExecute[
    "ClickElement" ->
        First@WebExecute[session,
          "LocateElements" ->
              "CSSSelector" -> ".dig-Button-icon-left-wrapper"]];
  Pause@2;
] /@ abcProblems;

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?