Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^5: WWW::Mechanize problem

by Khen1950fx (Canon)
on May 06, 2012 at 16:14 UTC ( [id://969153]=note: print w/replies, xml ) Need Help??


in reply to Re^4: WWW::Mechanize problem
in thread WWW::Mechanize problem

Here's a script that I did before you made your last post.
#!/usr/bin/perl use strict; use warnings; use Encode; use URI::file; use WWW::Mechanize; use Data::Dumper::Concise; my $page = 'http://www.perlmonks.org'; my $tmpfile = '/tmp/mech.log'; my $mech = WWW::Mechanize->new( cookie_jar => undef ); $mech->get( $page, ':content_file' => $tmpfile ); my $uri = URI::file->new_abs( $tmpfile )->as_string; my($field) = $mech->get( $uri ); open IN, '<', $tmpfile or die $!; open OUT, '>', \*OUT or die $!; binmode OUT, ":encoding(UTF-8)"; FIRST_FORM: { my $length = length(Encode::encode_utf8($field)); my @find_text = $mech->find_all_inputs( type => 'text' ); foreach my $find_text( @find_text ) { unless ($length > 100) { print Dumper( $find_text ); } } } close IN; close OUT;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://969153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-20 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found