Perlについての質問箱 47箱目

このエントリーをはてなブックマークに追加
267uy ◆yyC0rYWEq2
require 'rubygems'
require 'mechanize'
require 'kconv'
agent = Mechanize.new

uri = URI.parse("http://www.google.co.jp/")

agent.get(uri)
agent.page.link_with(:text => "Gmail".toutf8).click


agent.page.form_with(:name => nil){|f|
f.field_with(:name => "Email").value = " ID "
f.field_with(:name => "Passwd").value = " password "
}.click_button
puts agent.page.uri

s = Kconv.tosjis(agent.page.body)

a = "</font></font> <b>"
b = "</b>"
puts "si nn tya ku"
s.scan(/#{a}(.*?)#{b}/) do | n |
puts n
end

余裕すぎワロタ