![](/icons/66279de.gif)
![](/icons/66279de.gif)
![](/icons/66279dou.gif)
![](/icons/66279de.gif)
![](/icons/66279de.gif)
#scanweb.rb
#使用方法ruby scanweb.rb www.jb51.net 将当前结果保存在c:1.txt
require 'net/http'
filename= File.
('c:1.txt',"w+")
$*[0]
nil
puts "hehe,没有输入网址"
![](/icons/66279else.gif)
h = Net::HTTP.
($*[0], 80)
resp, data = h.get('/index.html', nil)
resp.message
"OK"
data.scan(/<a href="(.*?)"/).each do |x|
puts x
filename.puts x
end
end
end
#无聊
有vbs、php、ruby版了
好像ruby比vbs快
和php不相上下![](/icons/66279dou2.gif)
=begin
修改
下
require 'net/http'
filename= File.
('1.txt',"w+")
$*[0]
nil
abort "使用方法举例:ruby #$0 www.sohu.com
结果放在当前目录1.txt"
end
h = Net::HTTP.
($*[0], 80)
resp, data = h.get('/index.html', nil)
resp.message
"OK"
data.scan(/<a href="(.*?)"/).each do |x|
puts x
filename.puts x
end
end
=end
最新评论