This file contains 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' | |
agent = Mechanize.new | |
url=" " | |
hash = {:name => ' ', :value => ' ', :path => '/', :domain => ' '} | |
cookie = Mechanize::Cookie.new(hash[:name], hash[:value]) | |
cookie.domain = hash[:domain] | |
cookie.path = hash[:path] | |
agent.cookie_jar.add(URI.parse(url), cookie) | |
page = agent.get(" ") | |
pp page |
This file contains 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
# encoding: utf-8 | |
require 'open-uri' | |
require 'nokogiri' | |
puts"======================" | |
puts "请输入要查询的日期并按回车结束:" | |
date = gets() | |
init_uri = "http://www.zhibo8.cc/" | |
doc = Nokogiri::HTML(open(init_uri)) | |
today=Time.now.day | |
id = case date.to_i |