2010-08-01から1ヶ月間の記事一覧
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74f02d8 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb74f02d8>
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7440360 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb7440360>
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7481360 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb7481360>
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74962d8 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb74962d8>
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74c432c ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb74c432c>
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb742f380 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb742f380>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb744232c ... >> page = agent.get('http://www.google.com/') => #<Mechanize::Page {url #<URI::HTTP:0xb74356b8 URL:http://www.google.co.jp/>} ... >> page.title => "Google"</mechanize::page></mechanize:0xb744232c>
以下のような HTML で <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-style-type" content="text/css"> <meta http-equiv="content-script-type" content="text/javascript"> <title>meta test</title> </head> <body> </body> </html>>> require 'mechanize' =>…
以下のような HTML で <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="content-style-type" content="text/css"> <meta http-equiv="content-script-type" content="text/javascript"> <title>meta test</title> </head> <body> </body> </html>>> require 'mechanize' =>…
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb748b360 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb748b360>
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7420380 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb7420380>
以下のような HTML で <html> <head> <title>link test</title> </head> <body> <a href="http://foo.org/" target="_blank">foo</a> <a href="http://bar.org/">bar</a> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74f02d8 ... >> page = agent.get('http://127.0.0.1:8080/test…</mechanize:0xb74f02d8>
以下のような 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>
以下のような 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>
以下のような 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:0xb74a82e4 ... >> page = agent.ge…</mechanize:0xb74a82e4>
以下のような 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:0xb74e232c ... >> page = agent.ge…</mechanize:0xb74e232c>
以下のような HTML で <html> <head> <title>iframe test</title> </head> <body> <iframe src="iframe1.html" name="i1" width="200" height="100">foo</iframe> <iframe src="iframe2.html" name="i2" width="400" height="300">bar</iframe> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #
以下のような HTML で <html> <head> <title>iframe test</title> </head> <body> <iframe src="iframe1.html" name="i1" width="200" height="100">foo</iframe> <iframe src="iframe2.html" name="i2" width="400" height="300">bar</iframe> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #
以下のような HTML で <html> <head> <title>iframe test</title> </head> <body> <iframe src="iframe1.html" name="i1" width="200" height="100">foo</iframe> <iframe src="iframe2.html" name="i2" width="400" height="300">bar</iframe> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #
以下のような HTML で <html> <head> <title>frame test</title> </head> <body> <frameset rows="30%,*"> <frame src="frame1.html"> <frame src="frame2.html"> </frameset> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb744a360 ... >> page = agent.get('http://127.0.0.1:8080…</mechanize:0xb744a360>
以下のような HTML で <html> <head> <title>frame test</title> </head> <body> <frameset rows="30%,*"> <frame src="frame1.html"> <frame src="frame2.html"> </frameset> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74c2360 ... >> page = agent.get('http://127.0.0.1:8080…</mechanize:0xb74c2360>
以下のような HTML で <html> <head> <title>frame test</title> </head> <body> <frameset rows="30%,*"> <frame src="frame1.html"> <frame src="frame2.html"> </frameset> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb7477360 ... >> page = agent.get('http://127.0.0.1:8080…</mechanize:0xb7477360>
以下のような 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:0xb74782d8 ... >…</mechanize:0xb74782d8>
以下のような 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:0xb748f2e4 ... >…</mechanize:0xb748f2e4>
以下のような 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:0xb7443380 ... >…</mechanize:0xb7443380>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74dc328 ... >> page = agent.get('http://google.com/') => #<Mechanize::Page {url #<URI::HTTP:0xb74cbeec URL:http://www.google.co.jp/>} {meta} ... >> page.encoding => "Shift_JIS" >> page.encoding = "EUC-JP" => "EUC-JP" >> page.e…</mechanize::page></mechanize:0xb74dc328>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb742a2e0 ... >> page = agent.get('http://google.com/') => #<Mechanize::Page {url #<URI::HTTP:0xb7419ea4 URL:http://www.google.co.jp/>} {meta} ... >> page.encoding => "Shift_JIS"</mechanize::page></mechanize:0xb742a2e0>
>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74a22e0 ... >> page = agent.get('http://google.com/') => #<Mechanize::Page {url #<URI::HTTP:0xb7491ea4 URL:http://www.google.co.jp/>} {meta} ... >> page.content_type => "text/html; charset=Shift_JIS"</mechanize::page></mechanize:0xb74a22e0>
以下のような HTML で <html> <head> <title>base test</title> <base href="http://127.0.0.1:8080/test00_base.html"> </head> <body> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74e1328 ... >> page = agent.get('http://127.0.0.1:8080/test00_base.html') => #</mechanize:0xb74e1328>
以下のような HTML で <html> <head> <title>base test</title> <base href="http://127.0.0.1:8080/test00_base.html"> </head> <body> </body> </html>>> require 'mechanize' => true >> agent = Mechanize.new => #<Mechanize:0xb74d7328 ... >> page = agent.get('http://127.0.0.1:8080/test00_base.html') => #</mechanize:0xb74d7328>