This Python script automates the process of logging in to LeetCode, retrieving solved problems, and saving their solution codes to local files.
- Automatically logs in to LeetCode using provided credentials.
- Retrieves solved problems and their solution codes.
- Saves solution codes to local files, organized by problem name.
- Python 3.x
- Selenium
- BeautifulSoup
-
Clone this repository to your local machine:
git clone https://github.com/SnazzyNivesh522/Leetcode_Extract_Your_Code.git
-
Install dependencies using pip:
pip install -r requirements.txt
-
Open
script.py
and provide your LeetCode username and password. -
Run the script:
python script.py
-
The script will log in to LeetCode, retrieve solved problems, and save their solution codes to local files in the
leetcode_solutions
directory.
- Make sure to review LeetCode's terms of service regarding automated scraping before using this script extensively.
This project is licensed under the MIT License - see the LICENSE file for details.