This Python script automates the process of downloading PDF files from an ArXiv webpage using Selenium and threading.
The script utilizes Selenium, a web automation tool, to navigate through an ArXiv webpage and extract links to PDF files. Threading is employed to speed up the download process by processing multiple links concurrently. The downloaded PDF files are saved in the same directory as the script.
-
Python and Libraries: Make sure you have Python installed on your system. Install the required libraries listed in
requirements.txtby running the following command:pip install -r requirements.txt -
WebDriver: Download the appropriate WebDriver for your browser. This script uses Chrome WebDriver, so ensure you have it downloaded and placed in your system PATH or specify its location in the script.
-
Run the Script: Execute the script by running
python pdf_downloader.pyin your terminal or command prompt. Replacepdf_downloader.pywith the actual name of your script. -
Follow Instructions: The script will open a Chrome browser window and navigate to the specified ArXiv webpage. It will then start downloading PDF files automatically.
-
Monitor Progress: You can monitor the progress of the script in the terminal or command prompt. It will display messages indicating the status of the download process.
-
Completion: Once all PDF files have been downloaded, the script will automatically close the browser window.
- URL: You can customize the
urlvariable in the script to target a different ArXiv webpage. - Chunk Size: Adjust the
chunk_sizevariable to control the number of links processed by each thread.
- Selenium: For web automation.
- Requests: For making HTTP requests.
- Threading: For concurrent processing of links.