473,395 Members | 1,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Automate the Website using perl module

Hi All
I Have installed Active perl in my system and I am new to perl and automation...Could some one tell me how to install the perl modules and how to use those modules with the perl for autmating the website ... it will be very helpful for me to start automation...
Oct 10 '08 #1
8 4204
Hi there,

To install the perl modules can refer this link:

http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlmodinstall.html

To answer your 2nd question, it's better to get it from the perl experts from this forum as even am newbiee to perl.

Regards,
Vijayarl
Oct 10 '08 #2
numberwhun
3,509 Expert Mod 2GB
CPAN provides excellent documentatio on installing perl modules. To use the module, you would first install it, then, specify it in the beginning of your Perl script as such:

Expand|Select|Wrap|Line Numbers
  1. use DBI;
  2.  
or even:

Expand|Select|Wrap|Line Numbers
  1. use Config::Scoped;
  2.  
Those are real module examples. What you put will depend on what module you are using. To use a module, you have to look at its page on CPAN as it will instruct you in its use.

Regards,

Jeff
Oct 10 '08 #3
KevinADC
4,059 Expert 2GB
If you are using active perl you use the PPM application to install modules. Activeperl comes with a lot of documentation, so find the documentation (in the activeperl folder) and read it.

Automation could mean anything so there is no way to help with that unless you specify what you want or are trying to do.
Oct 10 '08 #4
If you are using active perl you use the PPM application to install modules. Activeperl comes with a lot of documentation, so find the documentation (in the activeperl folder) and read it.

Automation could mean anything so there is no way to help with that unless you specify what you want or are trying to do.
Hi Kevin Thanks for ur reply

What i have to do is I want to Login in to my site by entering username and password and later i want to click on any button for furthur process..

And i am working on windows machine ie Windows XP...
Oct 13 '08 #5
über
31
This might help
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. #-----------------------------
  3. # GET REQUEST
  4. #
  5. use LWP::Simple;
  6. use URI::URL;
  7.  
  8. my $url = url('http://login.yahoo.com/');
  9. $url->query_form(username => 'peter', password => 'secret');
  10. $content = get($url);
  11.  
  12. #-----------------------------
  13. # POST REQUEST
  14. #
  15. use HTTP::Request::Common qw(POST);
  16. use LWP::UserAgent;
  17.  
  18. $ua = LWP::UserAgent->new();
  19. my $req = POST 'http://login.yahoo.com/',
  20.    [ username => 'peter', password => 'secret' ];
  21. $content = $ua->request($req)->as_string;
Oct 13 '08 #6
numberwhun
3,509 Expert Mod 2GB
This might help
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. #-----------------------------
  3. # GET REQUEST
  4. #
  5. use LWP::Simple;
  6. use URI::URL;
  7.  
  8. my $url = url('http://login.yahoo.com/');
  9. $url->query_form(username => 'peter', password => 'secret');
  10. $content = get($url);
  11.  
  12. #-----------------------------
  13. # POST REQUEST
  14. #
  15. use HTTP::Request::Common qw(POST);
  16. use LWP::UserAgent;
  17.  
  18. $ua = LWP::UserAgent->new();
  19. my $req = POST 'http://login.yahoo.com/',
  20.    [ username => 'peter', password => 'secret' ];
  21. $content = $ua->request($req)->as_string;
Just a bit of advice Uber, it is highly advised and recommended in "Perl Best Practices" to put all of your "use" statements at the top of your script. You don't want to scatter them throughout your script or finding dependencies for scripts will be hell for others. I, personally, would not want to support code that did something like that. I have supported some pretty bad code and it is never fun!

Regards,

Jeff
Oct 13 '08 #7
Just a bit of advice Uber, it is highly advised and recommended in "Perl Best Practices" to put all of your "use" statements at the top of your script. You don't want to scatter them throughout your script or finding dependencies for scripts will be hell for others. I, personally, would not want to support code that did something like that. I have supported some pretty bad code and it is never fun!

Regards,

Jeff
Hey jeff..Thnk u very much..

And one thing i want to know is i can run these scripts in perl express right? or do i need to run in any other toll..Just mention those if possible..
Basically perl express is a editor i am using right now.....

And actually LWP module is itself installed while installing active perl in my sys....ie..LWP perl module pogram is existing in the path C:\Perl\lib\LWP

Do i need to install again if i use these in my scripts

Thanks in advance
Oct 16 '08 #8
numberwhun
3,509 Expert Mod 2GB
Hey jeff..Thnk u very much..

And one thing i want to know is i can run these scripts in perl express right? or do i need to run in any other toll..Just mention those if possible..
Basically perl express is a editor i am using right now.....

And actually LWP module is itself installed while installing active perl in my sys....ie..LWP perl module pogram is existing in the path C:\Perl\lib\LWP

Do i need to install again if i use these in my scripts

Thanks in advance
If its installed, then no, you shouldn't have to install them again, just the once. I don't know anything about Perl Express, but when you run perl scripts, you should really be running them from the command line to test them. Use the following format for that:

Expand|Select|Wrap|Line Numbers
  1. c:> perl scriptname.pl
  2.  
Oct 16 '08 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Keith | last post by:
All: What is the difference between Perl (CGI) and PHP (Apache module)? I thought both used servers to direct the user to the appropiate Perl or PHP program in order to execute the program to...
17
by: Michael McGarry | last post by:
Hi, I am just starting to use Python. Does Python have all the regular expression features of Perl? Is Python missing any features available in Perl? Thanks, Michael
2
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # suppose you want to fetch a webpage. from urllib import urlopen print urlopen('http://xahlee.org/Periodic_dosage_dir/_p2/russell-lecture.html').read() #...
1
by: Someone | last post by:
there's a korn shell script that i would like to wrap a perl script around to automate it, as a task i need to do always chooses the same options from this script (it's menu driven). can i somehow...
2
by: vallinayagam | last post by:
I wish to know how to automate data entry in web pages using perl. Thanks in advance.
6
by: Doomster | last post by:
In a previous job, we had Perl scripts which could interact with a SQL DB using Perl's DBI module We were able to programmatically add, delete and query tables using this module. Is it possible...
10
by: rdps | last post by:
hello, I am trying to open up a webpage, say "http://gmail.com", enter username, passwd, click on submit button and do loads of other things - ALL THROUGH AUTOMATION, writing a script in python. ...
0
by: raghavendrap | last post by:
Hello friends, I need help to automate verilog modules. Suppose i have verilog modules ax.v, bx.v, cx.v, dx.v ---------- individual modules, ...
2
by: somsub | last post by:
Hi all, Here is my samle code use strict ; use warnings ; use IO::Uncompress::Unzip ; When I compiled this three lines of code in win32 I got error like below.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.