2010-09-01から1ヶ月間の記事一覧

mechanize:Mechanize::Form#click_button

以下の定義で click_button にそんなに意義あるのか??? 「buttons.first」の「buttons」って何? → 「attr_reader :buttons」なので、@buttons か〜 # Submit this form with the button passed in def submit button=nil, headers = {} @mech.submit(sel…

mechanize:Mechanize::Form#checkboxes_with, #checkboxes

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="checkbox" name="checkbox1" value="foo" />Foo <input type="checkbox" name="checkbox1" value="bar" />Bar <input type="checkbox" name="checkbox1" value="baz" />Baz </form></body></html>

mechanize:Mechanize::Form#checkbox_with, #checkbox

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="checkbox" name="checkbox1" value="foo" />Foo <input type="checkbox" name="checkbox1" value="bar" />Bar <input type="checkbox" name="checkbox1" value="baz" />Baz </form></body></html>

mechanize:Mechanize::Form#buttons_with, #buttons

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="submit" value="Send" /> <input type="reset" value="Cancel" /> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #

mechanize:Mechanize::Form#button_with, #button

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="submit" value="Send" /> <input type="reset" value="Cancel" /> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #

mechanize:Mechanize::Form#build_query

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="post" action="cgi/foo00.cgi" name="form1"> </form> <form method="post" action="cgi/foo01.cgi" name="form2"> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7464594 ... >…</mechanize:0xb7464594>

mechanize:Mechanize::Form#add_field!

以下を確認lib/mechanize/form.rb def add_field!(field_name, value = nil) fields << Field.new({'name' => field_name}, value) end def []=(field_name, value) f = field(field_name) if f.nil? add_field!(field_name, value) else f.value = value en…

mechanize:Mechanize::Form#add_button_to_query

以下を確認lib/mechanize/form.rb def add_button_to_query(button) @clicked_buttons << button end lib/mechanize.rb def submit(form, button=nil, headers={}) form.add_button_to_query(button) if button

mechanize:Mechanize::Form#, #=

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/test_form01.cgi" name="form1"> <input type="text" name="text1" value="FOO" /> <textarea name="textarea1" rows="4" cols="40">foo</textarea> <input type="submit" value="Send" /> </form> </body> </html>以下…

mechanize:Mechanize::Form#page

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> </form> <form method="post" action="cgi/foo01.cgi" name="form2"> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7431540 ... >>…</mechanize:0xb7431540>

mechanize:Mechanize::Form#form_node

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> </form> <form method="post" action="cgi/foo01.cgi" name="form2"> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb746b538 ... >>…</mechanize:0xb746b538>

mechanize:Mechanize::Form#enctype

>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7490540 ... >> page = agent.get('http://www.google.com/') => #<Mechanize::Page {url #<URI::HTTP:0xb74838cc URL:http://www.google.co.jp/>} ... >> f = page.form_with(:name => "f") => #<Mechanize::Form {name "f"} ... >> f.enctype…</mechanize::form></mechanize::page></mechanize:0xb7490540>

mechanize:Mechanize::Form#checkboxes

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="checkbox" name="checkbox1" value="foo" />Foo <input type="checkbox" name="checkbox1" value="bar" />Bar <input type="checkbox" name="checkbox1" value="baz" />Baz </form></body></html>

mechanize:Mechanize::Form#radiobuttons

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="radio" name="radio1" value="foo" checked="checked" />Foo <input type="radio" name="radio1" value="bar" />Bar </form> </body> </html>>> require 'mechanize' => true …

mechanize:Mechanize::Form#file_uploads

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="file" name="File" /> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7423594 ... >> page = agent.get('http://127.0…</mechanize:0xb7423594>

mechanize:Mechanize::Form#buttons

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="submit" value="Send" /> <input type="reset" value="Cancel" /> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #

mechanize:Mechanize::Form#fields

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> <input type="text" name="text1" /> <input type="hidden" name="hidden1" /> <textarea name="textarea1" rows="4" cols="40">foo</textarea> </form> </body> </html>>> require 'mechan…

mechanize:Mechanize::Form#name

以下のような HTML で <html> <head> <title>form test</title> </head> <body> <form method="get" action="cgi/foo00.cgi" name="form1"> </form> <form method="post" action="cgi/foo01.cgi" name="form2"> </form> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb749d538 ... >>…</mechanize:0xb749d538>

mechanize:Mechanize::Form#action

>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7496594 ... >> page = agent.get('http://www.google.com/') => #<Mechanize::Page {url #<URI::HTTP:0xb7489920 URL:http://www.google.co.jp/>} ... >> search_form = page.form_with(:name => "f") => #<Mechanize::Form {name "f"} ... >>…</mechanize::form></mechanize::page></mechanize:0xb7496594>

mechanize:Mechanize::Form#method

>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74975ac ... >> page = agent.get('http://www.google.com/') => #<Mechanize::Page {url #<URI::HTTP:0xb748a938 URL:http://www.google.co.jp/>} ... >> search_form = page.form_with(:name => "f") => #<Mechanize::Form ... >> search_for…</mechanize::form></mechanize::page></mechanize:0xb74975ac>

mechanize:Mechanize::Page::Meta.parse

まんま >> require 'mechanize' => true >> uri = URI.parse('http://current.com/') => #<URI::HTTP:0xb746a82c URL:http://current.com/> >> Mechanize::Page::Meta.parse("5;url=http://example.com/", uri) => ["5", "http://example.com/"] >> Mechanize::Page::Meta.parse("5;url=", uri) => ["5", "h</uri::http:0xb746a82c>…

mechanize:Mechanize::Page::Label#for

以下のような HTML で <html> <head> <title>label test</title> </head> <body> <form method="post" action="cgi/test_form00.cgi" name="form1"> <input type="radio" name="radio1" id="r1" value="male" checked="checked"><label for="r1">Male</label> <input type="radio" name="radio1" id="r2" value="female"></form></body></html>

mechanize:Mechanize::Page::Label#page

以下のような HTML で <html> <head> <title>label test</title> </head> <body> <form method="post" action="cgi/test_form00.cgi" name="form1"> <input type="radio" name="radio1" id="r1" value="male" checked="checked"><label for="r1">Male</label> <input type="radio" name="radio1" id="r2" value="female"></form></body></html>

mechanize:Mechanize::Page::Label#text

以下のような HTML で <html> <head> <title>label test</title> </head> <body> <form method="post" action="cgi/test_form00.cgi" name="form1"> <input type="radio" name="radio1" id="r1" value="male" checked="checked"><label for="r1">Male</label> <input type="radio" name="radio1" id="r2" value="female"></form></body></html>

mechanize:Mechanize::Page::Label#node

以下のような HTML で <html> <head> <title>label test</title> </head> <body> <form method="post" action="cgi/test_form00.cgi" name="form1"> <input type="radio" name="radio1" id="r1" value="male" checked="checked"><label for="r1">Male</label> <input type="radio" name="radio1" id="r2" value="female"></form></body></html>

mechanize:Mechanize::Page::Image#url

以下のような HTML で <html> <head> <title>image test</title> </head> <body> <img src="img1.png" width="256" height="128" alt="foo"> <img src="img2.png" width="200" height="100" alt="bar"> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74d0604 ... >> page = agent.ge…</mechanize:0xb74d0604>

mechanize:Mechanize::Page::Image#src

以下のような HTML で <html> <head> <title>image test</title> </head> <body> <img src="img1.png" width="256" height="128" alt="foo"> <img src="img2.png" width="200" height="100" alt="bar"> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74f2538 ... >> page = agent.ge…</mechanize:0xb74f2538>

mechanize:Mechanize::Page::Image#page

以下のような HTML で <html> <head> <title>image test</title> </head> <body> <img src="img1.png" width="256" height="128" alt="foo"> <img src="img2.png" width="200" height="100" alt="bar"> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7477540 ... >> page = agent.ge…</mechanize:0xb7477540>

mechanize:Mechanize::Page::Image#node

以下のような HTML で <html> <head> <title>image test</title> </head> <body> <img src="img1.png" width="256" height="128" alt="foo"> <img src="img2.png" width="200" height="100" alt="bar"> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb742a538 ... >> page = agent.ge…</mechanize:0xb742a538>

mechanize:Mechanize::Page::Link#click

以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://www.yahoo.co.jp/">Yahoo!</a> <a href="http://www.google.co.jp/">Google</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb741d360 .. >> page = agent.get('http://127.0.0.1:808…</mechanize:0xb741d360>