Re: Script to insert data to a web page?



On Jan 2, 2:51 pm, News123 <news...@xxxxxxx> wrote:
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.pmhttp://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.- Hide quoted text -

- Show quoted text -

Thanks again. I have been trying that but the documentation isn't the
best. I am looking for a little better working example to play with.
.



Relevant Pages

  • Re: Script to insert data to a web page?
    ... I am a Perl novice and am looking for a simple script to access a web ... page, enter some data, and examine the response. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)
  • Re: Web programming: issues with large amounts og data
    ... script appearing to freeze. ... portions of the (Perl) code. ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ... merchants is the presently commented out code is uncommented and the ...
    (comp.lang.perl.misc)
  • Re: Why doesnt this UserAgent script work?
    ... >> It works just find, with strict and warnings, from the command ... >probably meant $response, though. ... should always test the script I am going to post. ... >It's the web server which complains - not Perl. ...
    (comp.lang.perl.misc)
  • Re: Scripting help
    ... > I appreciate your quick response. ... > Is there any way I get the time taken for the execution of a script from ... > the script itself instead of typing it at the command line. ... I prefer to use Perl anyways, but I would've like to get this working ...
    (RedHat)
  • Re: How to unable the use of tainted mode in a CGI script ?
    ... I have to use a long perl script which use the "tainted mode" (-T ... dedicated server. ... What I have to do to remove the tainted mode in the script? ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (comp.lang.perl.misc)