This Python script uses Selenium to scrape data from a Reddit subreddit and write the results into a text file of (Title, upvotes, links) format.
- Python 3
- Selenium
- ChromeDriver (ensure it's in the system PATH or provide the path to it in the script) https://googlechromelabs.github.io/chrome-for-testing/
- Install Python 3 from python.org.
- Install Pip
- pip install -r requirements.txt (It's preferable if you run it in a virutal env)
- Run the script:
python reddit_scraper.py. - Enter the subreddit when prompted.
- The script will scrape data from the subreddit, and you will be prompted if you want to proceed to the next page.
- The results will be written into a text file named according to the current date and time.
- ChromeDriver executable path is set in the
service = Service(executable_path="chromedriver.exe")line. Make sure to provide the correct path to your ChromeDriver executable.
This project is licensed under the MIT License - see the LICENSE file for details.