在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
require 'net/http'
count = 1..100000 # define an array count.each{ # each |index| # element is index 1 2 3 4 5 6 printf "#{index} " #print index and space h = Net::HTTP.new('space.cnblogs.com',80) # create a object resp, data = h.get('/group/topic/1605/',nil) # get if resp.code != "200" # if http response status code not is 200 puts resp.code #put status code puts resp.message #put status message resp.each{ #put headers |key, val| puts "#{key}\t\t\t#{val}" } p data #put html break # break the eache end #sleep(1) #sleep use second do inteval } 为什么博客园的代码没有Ruby格式的 看来我只能用python格式的了 写这种小东西 python和ruby perl 都很快很好用 呵呵 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论