Re: Script to insert data to a web page?
- From: News123 <news123@xxxxxxx>
- Date: Fri, 02 Jan 2009 21:51:03 +0100
Chad wrote:
On Jan 2, 1:52 pm, Tim Greer <t...@xxxxxxxxxxxxx> wrote:
Chad wrote:
Hi there,
I am a Perl novice and am looking for a simple script to access a web
page, enter some data, and examine the response.
Does anyone have anything like this?
Hi,
This can be anything from quite trivial to quite annoying, depending on
the web server and the amount of Cookies, Javascript, Flash Plugins,
Java Applets being sued by your page.
You should probably look at following modules
- LWP::UserAgent # to access the page, enter the data and post/get it
- WWW::Mechanize # sub class of LWP::UserAgent, probably simpler,
# but I never used ut
- HTML::Parser # to examine the response. If the response is very simple
you could also just use a regular expression.
- HTTP::Cookies # Only needed if browsing the page doesn't work without
cookies
Please note, that these modules are not necessarily installed on your PC,
To find out whether a module exists, you coulcd check,
You can try to executa an empty perl script, which uses this module:
perl -MLWP::UserAgent -e ''
or you try to read the module's documentation:
perldoc LWP::UserAgent # if there's no doc the module doesn't exist
Installing these modules depends on your OS / perl distribution
For examples you can look at:
http://search.cpan.org/~gaas/libwww-perl-5.822/lib/LWP/UserAgent.pm
http://search.cpan.org/~petdance/WWW-Mechanize-1.52/lib/WWW/Mechanize.pm
bye
N
. ..
There are a lot of scripts that accept data entered and then respond
accordingly. I'd wager that a high majority of scripts for the web are
designed for that specific task. What exactly are you looking to
do/have passed to it and process (and display a result, I assume)?
There are likely existing scripts to do exactly what you want.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
Hi there,
Wow, thanks for the quick response. I have a large list of objects
that I want to enter on a web page to see if they exist. So the basic
flow would be read file, send object name to the web page, hit search,
return the result.
- Follow-Ups:
- Re: Script to insert data to a web page?
- From: Chad
- Re: Script to insert data to a web page?
- References:
- Script to insert data to a web page?
- From: Chad
- Re: Script to insert data to a web page?
- From: Tim Greer
- Re: Script to insert data to a web page?
- From: Chad
- Script to insert data to a web page?
- Prev by Date: Re: Is Moose the best for Perl object-oriented programming?
- Next by Date: Re: hash table usage questions
- Previous by thread: Re: Script to insert data to a web page?
- Next by thread: Re: Script to insert data to a web page?
- Index(es):
Relevant Pages
|