I need to download all the PDF files present on a site. Trouble is, they aren't listed on any one page, so I need something (a program? a framework?) to crawl the site and download the files, or at least get a list of the files. I tried WinHTTrack, but I couldn't get it to work. DownThemAll for Firefox does not crawl multiple pages or entire sites. I know that there is a solution out there, as I couldn't have possibly been the first person to be presented with this problem. What would you recommend?
|
feedback
|
|
Is the site indexed by Google? You could just search Example: site:en.wikipedia.org filetype:pdf Another way to do it would be by using wget, which is a *nix command line tool, but is available for windows. By using recursive mode and specifying to only save pdf files, it could traverse a site and find all the PDFs.
I haven't actually tested using WGET with just a specific filetype before, but I've done recursive downloads before and it's worked fine, so you might want to give it a try. | ||||
feedback
|
|
I can advice you to use jsoup, the Java HTML Parser if you're familiar with Java or BeautifulSoup if you're familiar with Python. Write recursive method which do next:
Something like that. | |||||
feedback
|
|
This is not the easiest solution, but it's my favorite. Write your own spider! Have it traverse the site, parse pages, and look for files you want. There are plenty of interesting challenges that come with writing a spider, and I found it a lot of fun. While this may not be what archer1742 was looking for, I'm sure someone (perhaps archer1742 as well) would like this solution. | |||
|
feedback
|