Using Puppeteer to generate PDFs from myanimelist.net/news. This can be useful for uploading PDFs to sites like Scribd.
-
Clone the repository:
$ git clone https://github.com/yourusername/myanimelist-to-pdf.git $ cd myanimelist-to-pdf
-
Install dependencies:
$ npm install
-
Run the script:
$ node index.js [URL]
Replace
[URL]
with the URL of the MyAnimeList news page you want to convert to PDF.
$ node index.js https://myanimelist.net/news
The script performs the following steps:
- URL Validation: Ensures a valid URL is provided.
- Filename Generation: Uses
faker
to generate a unique filename for the PDF. - Directory Check: Ensures the target directory exists, creating it if necessary.
- Browser Automation: Launches Puppeteer, navigates to the provided URL, and handles any modal dialogs.
- PDF Generation: Saves the webpage as a PDF in the
./pdfs
directory.
Feel free to submit issues or pull requests. Contributions are welcome!
This project is licensed under the MIT License.