book-scraper
v1.0.0
Published
**Book-Scraper** is a tool that allows you to convert your online books into PDFs, even if they are not directly downloadable.
Readme
Book-Scraper
Book-Scraper is a tool that allows you to convert your online books into PDFs, even if they are not directly downloadable.
Getting Started
Follow these steps to set up and use the scraper:
1. Clone the Repository
First, clone the repository to your local machine using Git:
git clone https://github.com/The-UnknownHacker/Book-Scraper2. Unzip (If Applicable) or Go to index.js
- If you downloaded a ZIP file, unzip it.
- If you cloned the repository using Git, navigate directly to the
index.jsfile in the project folder.
3. Install Dependencies
Before running the script, make sure you have installed the necessary dependencies. Run:
npm install4. Run the Scraper Script
To start the screenshot scraping process, run the following command:
node index.js5. Set Screenshot Coordinates
Use any tool to get the exact coordinates for the screenshot area you want to capture on the screen. You can use tools like:
- Snipping Tool (Windows)
- Snip & Sketch (Windows)
- Screenshot Tool (Mac)
- Any other screenshot tool that allows you to select a specific area of the screen.
6. Start and Stop the Script
- Press
gto start the script. - Press
gagain to stop the script once you’ve captured enough pages.
7. How the Script Works
The script will:
- Take a screenshot of the selected area.
- Save the screenshot to your local storage.
- Flip to the next page by simulating the right arrow key (
→) press.
8. Combine Screenshots into a PDF
Once you've captured all your screenshots, you can use the combine.py script in the repository to combine them into a single PDF file. Here's how to use it:
- Ensure you have Python installed on your system.
- Run the following command to combine all screenshots into a PDF file:
python combine.py - The output will be a
.pdffile containing all the screenshots.
Notes for Combining Screenshots:
- Ensure all screenshots are in the same directory as the
combine.pyscript. - The script will automatically order the screenshots in the filename sequence (
screenshot-1.png,screenshot-2.png, etc.).
Requirements
- Node.js (v12 or higher)
- Python (for
combine.py) - Any web browser with the book loaded
Example Usage
- Open the book page you want to scrape.
- Start the script with the
gkey. - Stop it when you’ve captured all the pages you need.
- Run the
combine.pyscript to combine the screenshots into a PDF.
License
This project is open source and available under the MIT License.
