80degreez has asked for the wisdom of the Perl Monks concerning the following question:
and this is the mech->content from the page after it's been uploadeduse strict; use WWW::Mechanize; use HTTP::Cookies; my $mech = WWW::Mechanize->new( stack_depth => 1, agent =>"Mozilla/5.0 + (X11; U; Linux i68+6; en-US; rv:1.7) Gecko/20040918 Firefox/0.9.3 ") +; my $pic = "C:\/LV3.JPG"; $mech->cookie_jar( HTTP::Cookies->new() ); $mech->get("http://tinypic.com"); if($mech->content() =~ /UPLOAD NOW/ ){ print "TinyPic loaded... "; $mech->form_name("upload_form"); $mech->field('the_file' => $pic); $mech->submit(); }
http://tinypic.com/view.php?pic=86gjua9 is what I'm trying to get it to pull from the page content<html> <head> <meta http-equiv="Content-Type" content="text/html; char +set=iso-8859-1" /> <meta name="description" content="TinyPic, a Photobucket + Video and Image Hosting company" /> <meta name="keywords" content="images, photos, videos, m +yspace, ebay, video hosting, photo hosting" /> <title>TinyPic - Share The Experience!™</title> <link href="http://static.tinypic.com/s/stylesheet.css" +rel="stylesheet" type="text/css" /> </head> <body> <table width="100%" height="95%"> <tr> <td valign="middle" align="center"> <form name="myform" method="post" action="http://tiny +pic.com/index.php" target="_parent"> <input type="hidden" name="pic" value="86gjua9" /> <input type="hidden" name="s" value="1"> <input type="hidden" name="ival" value="11" /> <input type="hidden" name="type" value=".jpg" /> <input type="hidden" name="domain_lang" value="en" /> <script language="javascript">document.myform.submit( +)</script> </form> <strong><a href="http://tinypic.com/view.php?pic=86gj +ua9&s=1" target="_blank">Click here</a> to view your image</strong> </td> </tr> </table> </body> </html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Matching Q?
by educated_foo (Vicar) on Nov 27, 2007 at 18:32 UTC | |
by 80degreez (Initiate) on Nov 27, 2007 at 18:42 UTC | |
by madbombX (Hermit) on Nov 27, 2007 at 18:53 UTC | |
by 80degreez (Initiate) on Nov 27, 2007 at 19:00 UTC | |
by jrsimmon (Hermit) on Nov 27, 2007 at 22:25 UTC | |
by madbombX (Hermit) on Nov 27, 2007 at 21:07 UTC |