Quote (Michael515 @ May 2 2016 02:12am)
Will do. Do you know if there's a specific name for what I'm trying to achieve here?
For the name you are looking to be creating what is known as a web scraper/spider. You are looking for a xml/html scraping/parsing library as well has the core library for issuing http requests. The xml/html library should be able to use xpaths for easier programming.
Using string searches is a terrible way to process html.
For instance in ruby I would do something like (this probably wont work and is untested, quickly generated the xpath and didn't check if it was correct):
Code
require "open-uri"
require "uri"
require "nokogiri"
doc = Nokogiri::HTML(open("https://www.artofproblemsolving.com/wiki/index.php?title=Mathematics_competitions_resources#Free"))
links = doc.xpath("//div[@id='mw-content-text']/ul[9]/a/@href")
links.each do |link|
download_stream = open(link)
uri = URI.parse(link)
IO.copy_stream(download_stream, "./#{File.basename(uri.path))}")
end
Quote (annexusquam @ May 2 2016 06:22am)
This is another option, wget or curl may be able to solve this easily. curl the webpage, grep for urls matching a http url ending in pdf, use wget/curl to fetch that link.
This post was edited by AbDuCt on May 2 2016 06:51am