Computing.Net > Forums > Programming > How to Open web-site/page through perl

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to Open web-site/page through perl

Reply to Message Icon

Name: Lakshmi sreekanth
Date: May 7, 2009 at 03:34:26 Pacific
OS: Debian Linux x86_64
Subcategory: C/C++
Comment:

Hi,
I am lakshmi sreekanth, new to Perl.

My Doubt: Is there any way to open web-page/site by using Perl program, OS:Debian Linux.

My requirement is i need to open the site, then collect the required data from that site, then send that data to the cell phone (SMS, through internet).

Please tell me whether its possible or not, if possible then tell me the way !!!

One more thing, is there any possibility to include HTML code in the Perl code...


Thanks & Regards,
Aura Networks



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: May 7, 2009 at 06:04:01 Pacific
Reply:

search CPAN for LWP module


0

Response Number 2
Name: chorny
Date: May 7, 2009 at 08:57:46 Pacific
Reply:

You should use LWP or WWW::Mechanize. WWW::Mechanize would be more convenient in your case.

For SMS sending there are plenty modules on CPAN.

To include HTML in you Perl program you need to either use heredocs (bad solution) or templates. Look at Template-Toolkit.


0

Response Number 3
Name: Lakshmi sreekanth
Date: May 7, 2009 at 19:15:48 Pacific
Reply:

Now i am trying!!
Thanks for your answers.

Regards,
Aura Networks


0

Response Number 4
Name: Lakshmi sreekanth
Date: May 8, 2009 at 04:51:12 Pacific
Reply:

#! /usr/bin/perl -w
use strict;
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $response = $ua->get('http://www.ttdsevaonline.com/eseva/availabilitychart.aspx?name=accom');
if ($response->is_success)
{
print $response->content; # or whatever
}
else
{
die $response->status_line;
}
---------------
I executed above code, its working fine.When i open the above site
[http://www.ttdsevaonline.com/eseva/availabilitychart.aspx?name=accom]

I am getting current month details, but the thing is i need to collect the another month details.
Site name same for this month & for next month. How can i open next month details ...!!
First how can we change the month??

Please help me ..

For understanding purpose please open the site ..

Regards,
Aura Networks


0

Response Number 5
Name: Lakshmi sreekanth
Date: May 11, 2009 at 00:52:12 Pacific
Reply:

Hi,
When i run the program, i am getting this error :

Can't locate object method "new" via package "WWW::Mechanize" (perhaps you forgot to load "WWW::Mechanize"?) at program.pl

OS: Debian Linux

Post me, whether i required to install any thing to work WWW::Mechanize->new() in the Program!!!

Regards,
Lakshmi Sreekanth


0

Related Posts

See More



Response Number 6
Name: ghostdog
Date: May 11, 2009 at 02:06:10 Pacific
Reply:

as the error message says, you probably forgot to do
"use WWW::Mechanize"


0

Response Number 7
Name: Lakshmi sreekanth
Date: May 11, 2009 at 02:43:15 Pacific
Reply:

#My Program
#----------------
#! /usr/bin/perl

use strict;
use warnings;
use WWW::Mechanize;

my $ua = WWW::Mechanize->new();
my $url = "http://www.ttdsevaonline.com/eseva/availabilitychart.aspx?name=accom";
my $FILE = ":content_file";
my $response = $ua->get($url, $FILE => "counter.html" );

if ($response->is_success)
{
print "Success, url opened, data stored in counter.html \n";
}
else
{
die $response->status_line;
}
#----------------------

Output:
home/sreekanth$ perl project_ttd.pl
Can't locate WWW/Mechanize.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at project_ttd.pl line 5.
BEGIN failed--compilation aborted at project_ttd.pl line 5.
$

How to rectify the Above error !!
Please help me.

Regards,
Aura Networks


0

Response Number 8
Name: ghostdog
Date: May 11, 2009 at 02:45:16 Pacific
Reply:

have you really installed WWW::Mechanize module? how did you install it ?


0

Response Number 9
Name: Lakshmi sreekanth
Date: May 11, 2009 at 03:53:00 Pacific
Reply:

Thank you very much for all of your helping..

Now its working(WWW::Mechanize),

Now my doubt is after opening the page how to select a particular field from a page, select or change the month field from the page(by default page contains present month details, i need next month details)..

(Please open this site for understanding purpose:
http://www.ttdsevaonline.com/eseva/availabilitychart.aspx?name=accom

After opening this site i need to change the month as i required, how can i change the month....!!!

Please please help me ..


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: How to Open web-site/page through perl

Batch file for Internet Explorer www.computing.net/answers/programming/batch-file-for-internet-explorer/18946.html

Rename Web Site Links www.computing.net/answers/programming/rename-web-site-links/6899.html

how to open .dat file www.computing.net/answers/programming/how-to-open-dat-file/12710.html