[Rio-pm] Mechanize e HTML::Form

Daniel de Oliveira Mantovani daniel.oliveira.mantovani em gmail.com
Quinta Abril 23 06:47:16 PDT 2009


Se você quer uma API, já existe uma pronta é só usar:

http://search.cpan.org/~rkrimen/Google-Search-0.022/lib/Google/Search.pm

2009/4/22 Denilson Silva <denilsongv2 em hotmail.com>

>
> oi pessoal,
>
>  To precisando manipular FORMS  pra fazer consultas automaticas na web, to
> tentando usar o modulo :
>
> Mechanize -
> http://search.cpan.org/~petdance/WWW-Mechanize-1.54/lib/WWW/Mechanize.pm<http://search.cpan.org/%7Epetdance/WWW-Mechanize-1.54/lib/WWW/Mechanize.pm>
>
> montei o script de exemplo :
>
>   #!usr/bin/perl
>   use strict;
>  use warnings;
>  use WWW::Mechanize;
>
>
>  my  $google = WWW::Mechanize->new();
>
>  my  $url='http://www.google.com.br';
>
>        $google->get($url);
>
>  my $busca = $google->content();
>
>        print $busca, "\n";
>
>        print "**********FORMS ************\n\n";
>
>  my @ref = $google->forms();
>
>
>       print @ref;
>
>
>
> O ULTIMO PRINT RETORNA :  HTML::Form=HASH(0x85ac988);
>
> o metodo forms() retorna uma lista de forms, nao entendi esse HASH,   se
> alguem souber como obter os forms agradeco !!
>
>
>
>
>
>
>
>
>
> - - - - - - - -- - - - - -- - - - -- - - - -- - - -- - - -- - -
>
> Denilson S. de Andrade
>  UFV - Universidade Federal de Viçosa
> denilson.andrade em ufv.br
>
>
>
>
> ------------------------------
> Quer saber qual produto Windows Live combina melhor com o seu perfil? Clique
> aqui e descubra! <http://www.windowslive.com.br>
>
> _______________________________________________
> Rio-pm mailing list
> Rio-pm em pm.org
> http://mail.pm.org/mailman/listinfo/rio-pm
>



-- 
http://mantovanihouse.blogspot.com/
This is my poney:
-------(\_------------_/)-----------
-------)--(----------)--(-----------
------(----(---------)----)----------
-------)----(-------)----(-----------
-------(----(-------)----)-----------
--------\_-(\\.---.//)-_/------------
----------\)' -8--8- '(/--------------
-----------/------------\---------------
----------(--)--------(--)--------------
------------(_c__c_)----------------
----------------------------------------
perl -MLWP::Simple -le 'grep{ print $1 if /href="(http.+?)"/}split($/,get("
http://www.perl.org.br"))'
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/rio-pm/attachments/20090423/54424216/attachment-0001.html>


Mais detalhes sobre a lista de discussão Rio-pm