This script allows users to scrape all saved Instapaper bookmarks and export them as CSV data.
- Scrapes all bookmarks from your Instapaper home page.
- Support scraping bookmarks from specific Instapaper folders
- Export bookmarks metadata in CSV format
The following Python libraries are required:
requests
beautifulsoup4
python-dotenv
Install all dependencies using the provided requirements.txt:
pip install -r requirements.txt
- Clone or download the repository.
- Create an
.env
file in the project root with your credentials:INSTAPAPER_USERNAME=your_username INSTAPAPER_PASSWORD=your_password
- Run the script:
# Output to console python scrape.py # Save output to CSV file python scrape.py > bookmarks.csv
INSTAPAPER_USERNAME
: Your Instapaper account usernameINSTAPAPER_PASSWORD
: Your Instapaper account passwordENABLE_FOLDER_MODE
: Set to 'true' to scrape a specific folderFOLDER_ID_AND_SLUG
: The folder ID and slug when folder mode is enabled
- Authenticate: Logs into Instapaper using your credentials
- Extract Bookmarks: Fetches bookmarks from either homepage or specific folder
- Process Pages: Iterates through all available pages of bookmarks
- Output CSV: Prints bookmark data in CSV format with headers
The script outputs CSV data with the following structure:
page,id,title,url
Page 1,999901234,"Article 1",https://www.example.com/page-1/
Page 1,999002345,"Article 2",https://www.example.com/page-2/
This script is forked and modified from:
Major modifications include:
- Switched from HTML/PDF downloads to CSV export format
- Added environment variable support using python-dotenv
- Implemented folder-specific bookmark scraping
- Enhanced documentation and examples
This script requires valid Instapaper credentials. Be cautious when using personal account information and ensure compliance with Instapaper’s Terms of Service.