Skip to content

Sick of that "Save as PDF" link on Wikipedia? Why not just have Python do it for you?

Notifications You must be signed in to change notification settings

iiviigames/wikipdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WikiPDF

Included here are 2 scripts, which will download a list of wikipedia pages in PDF format without going through the hassle of clicking the "Download Page as PDF" link every time you find an interesting article.

WikiPDFColor Usage

wikipdfcolor.py

  • The new and improved version! As long as you've got a decent terminal (I recommend ConEmu for Windows users!), you should have a lovely, color coded and more intuitive experience overall using the script!

wikipdf.py

  • The classic version. Uglier, less user friendly.

How To Use the Script

  • Save this git in the folder you'd like to run the code from. I'll say it's C:\Users\{your_name}\Desktop for this example.

  • Extract the zip file to a folder on the Desktop called WikiPDF or whatever you want.

  • See the file in there called tst.txt? That's how you need to format the .txt files for whatever pages you want to download. If they aren't on new lines, or written just like they are in their actual wikipedia page titles, you may see errors.

    • Here's a nice photo, just to have a visual reference of how it should look.

    • Text File Format

  • Run wikipdf.py or wikipdfcolor.py - your choice. A console window will pop up. Here's a clip of me using the color version.

    • wikipdfcolor

  • The color version will give you a couple of different regularly used file locations, along with the folder you launched the program from. You can enter the corresponding number to make a selection, and then press ENTER.

    • You can also choose to enter a custom directory by choosing option 5, and then typing in any path you'd like.
    • The classic version requires you to enter the location that the textfile you want to use is in. It's bad, and less pretty, and I don't think you should use this one. (The code is less efficient and more obnoxious too!)
  • After making your selection, all .txt files present in the chosen directory will be displayed without their extensions visible. This is just for aesthetics, I promise they are .txt files.

  • Finally, enter the file's name (in the example it's tst) and pres ENTER.

BOOM!

The magic begins!


With Solidarity,

🔮 iivii

About

Sick of that "Save as PDF" link on Wikipedia? Why not just have Python do it for you?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages