--+HP7ph2BbKc20aGI
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Jun 20, 2010 at 11:45:31AM +0900, Pen Ttt wrote:
> require 'rubygems'
> require 'mechanize'
> agent =3D WWW::Mechanize.new
> agent.user_agent_alias =3D 'Windows IE 7'
> page =3D agent.post("http://sso.chinaunix.net/Login?")
> form =3D page.forms[0]
> form['login_name'] =3D 'luofeiyu'
> form['password'] =3D 'qwerty'
> page =3D agent.submit(form)
> page.save("/home/pt/web")
>=20
> irb(main):166:0>  form =3D page.forms[0]
> =3D> nil

This line ^^^^^

This page appears to have no forms, so it returned nil.

--=20
Aaron Patterson
http://tenderlovemaking.com/

--+HP7ph2BbKc20aGI
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iQEcBAEBAgAGBQJMH/WuAAoJEJUxcLy0/6/GBXMH/A9/AyVUAsddx7FOAdvyF1CD
xRg1IPvcZBr4Lc6hJ5NCxnF+kxVLqyTzJFyWf4r/ALN37viqILifxmf9skPIdH8/
ZxTTESn3A6RX52FDB5Oiz2zTZoRftFDTrg/5QtBlO2UpHsuFEHmpsO2BXIBu5CGx
VPrMERkApUYK7NjGd5h58S4ywA3xke45YcdDJtnscF4Ib16Wrzf4XzcxCejk/vN7
YzvSiEGfAtVex9GG81AcVAFmv66KtQZwuuR5IAzZpELjNC/ZJ8WEDt5krDj3iZUo
qYvf6ZZ7w4+iTPPpiLxbQSqeMTEZnL1OpgYKoWAxQvIu0bKR7hWp6tNCvgEmjIY=
=C5RB
-----END PGP SIGNATURE-----

--+HP7ph2BbKc20aGI--