<div dir="ltr">Hello Robert,<div><br></div><div>I don't have the script handy, but I've used Mojo::UserAgent in the past as it makes this trivial.</div><div><br></div><div>I realize most people don't think, "hey, I need a way to interact with a webpage, let's install a web building framework", but it sounds like exactly what you are looking for.</div>
<div><br></div><div>you can do something along the lines of:</div><div><br></div><div>#!/usr/bin/perl</div><div>use 5.010;<br></div><div>use strict;</div><div>use warnings;</div><div><br></div><div>use Mojo::UserAgent;</div>
<div><br></div><div>my $url = '<a href="http://example.com">http://example.com</a>';</div><div><br></div><div>my $ua = Mojo::UserAgent->new;</div><div><br></div><div>my $result = $ua->post( $url . '/someform' => form => { somefield => 'some value', anotherfield => 'another valule' } );</div>
<div><br></div><div># do stuff with result</div><div><br></div><div>my ($url) = $result =~ /(http:\/\/.*)/; # this is not a good regex for a number of reasons you'll have to figure out how to grab the url yourself</div>
<div><br></div><div>$ua->get($url);</div><div><br></div><div>I remember finding Mojo::UserAgent because I was having similar problems with WWW::Mech. (and the guys on the #mojo channel on <a href="http://irc.perl.org">irc.perl.org</a> are usually super helpful).</div>
<div><br></div><div>The docs leave something to be desired, but check out: <a href="http://mojolicio.us/perldoc/Mojo/UserAgent">http://mojolicio.us/perldoc/Mojo/UserAgent</a></div><div><br></div><div>Best Regards,</div><div>
Jon A</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 26, 2014 at 1:00 PM, <span dir="ltr"><<a href="mailto:denver-pm-request@pm.org" target="_blank">denver-pm-request@pm.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Denver-pm mailing list submissions to<br>
<a href="mailto:denver-pm@pm.org">denver-pm@pm.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://mail.pm.org/mailman/listinfo/denver-pm" target="_blank">http://mail.pm.org/mailman/listinfo/denver-pm</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:denver-pm-request@pm.org">denver-pm-request@pm.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:denver-pm-owner@pm.org">denver-pm-owner@pm.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Denver-pm digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. WWW::Mech examples (Robert L. Harris)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 25 Aug 2014 15:49:34 -0600<br>
From: "Robert L. Harris" <<a href="mailto:robert.l.harris@gmail.com">robert.l.harris@gmail.com</a>><br>
To: <a href="mailto:Denver-pm@pm.org">Denver-pm@pm.org</a><br>
Subject: [Denver-pm] WWW::Mech examples<br>
Message-ID:<br>
<CAOXayVsUp4TTwLomxipFJ3NJk19n60jzzmuQu=<a href="mailto:KBkN%2B8vk9J7Q@mail.gmail.com">KBkN+8vk9J7Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
I'm working on a new script to pull some files off an internal company<br>
app server. I'm trying to figure it out using some examples I've found<br>
online but figured I'd ask. Anyone have a script that does something close<br>
to this in a simple, easy to figure out manner:<br>
<br>
<br>
Connect to <a href="http://apps.company.com" target="_blank">http://apps.company.com</a><br>
Submit 4 values into a form and hit submit.<br>
* This triggers some dynamic output that runs for a few mins while it<br>
generates some data then gives a link at the bottom.<br>
Grab the link at the bottom<br>
Download a .tgz off of the resulting link's page<br>
<br>
Robert<br>
<br>
<br>
--<br>
:wq!<br>
---------------------------------------------------------------------------<br>
Robert L. Harris<br>
<br>
DISCLAIMER:<br>
These are MY OPINIONS With Dreams To Be A King,<br>
ALONE. I speak for First One Should Be A Man<br>
no-one else. - Manowar<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.pm.org/pipermail/denver-pm/attachments/20140825/326b0f05/attachment-0001.html" target="_blank">http://mail.pm.org/pipermail/denver-pm/attachments/20140825/326b0f05/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
Denver-pm mailing list<br>
<a href="mailto:Denver-pm@pm.org">Denver-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/denver-pm" target="_blank">http://mail.pm.org/mailman/listinfo/denver-pm</a><br>
<br>
<br>
------------------------------<br>
<br>
End of Denver-pm Digest, Vol 13, Issue 1<br>
****************************************<br>
</blockquote></div><br></div>