Created
November 8, 2017 07:45
-
-
Save kaosf/af524a68c4f39a0f5f94582da8723b4b to your computer and use it in GitHub Desktop.
Idol time PriPara ani.tv URL parser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url_common = 'https://ch.ani.tv' | |
url = url_common + '/titles/353' # 353 is ipp ID | |
require 'open-uri' | |
html = open(url).read | |
require 'nokogiri' | |
doc = Nokogiri::HTML.parse html | |
# latest only | |
#puts url_common + doc.xpath('//*[@id="title-detail"]/div[1]/div[3]/div/a').attribute('href') | |
# 1, 2, 3, ... latest | |
doc.xpath('//*[@id="title-detail"]/div[1]/div[4]/div/a').each do |e| | |
puts url_common + e.attribute('href') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment