Skip to content

JiaminL/LeetCode-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Solutions-Crawler

Flexible Assignment 2 of course « Web Information Processing and Application »

Instructions

Because LeetCode recently added Google's reCAPTCHA, a spider client can no longer log in to LeetCode and access its GraphQL endpoint. So this spider is written in JavaScript and runs in a browser.

Open a browser (latest Chrome recommended), log in to your LeetCode account manually, and run the following script in Developer Console (usually available after pressing F12):

$.getScript("https://raw.githubusercontent.com/JiaminL/LeetCode-Solutions/master/script.js")

Wait for a few moments for the script to complete. Depending on your network connectivity this may take a few minutes or sometimes minutes. After it's completed, simply run saveResult() in the console to download the result as a JSON file.

Output format

This is the required format from the TAs.

{
  "questionId": "135",
  "titleSlug": "candy",
  "solutions": [
    {
      "language": "Python3",                  // 解答语言
      "code": "class Solution:\n...",         // 解答代码
      "source": "讨论版"                      // 爬取来源,自行填写
    }
  ]
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published