Created
May 10, 2015 02:38
-
-
Save cisolarix/b5b5f96d26bbb7e0224f to your computer and use it in GitHub Desktop.
xunlei_download_links_grabber
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
require 'mechanize' | |
a = Mechanize.new | |
File.open('links.txt', 'w') do |file| | |
a.get('http://kuai.xunlei.com/d/z51zDAKLFgAjwMdT993') do |page| | |
links = page.links_with(class: 'file_name') | |
links.each do |l| | |
file.write(l.href + "\n") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TODO: 将 URL 做成参数