Connecting Tech Pros Worldwide Forums | Help | Site Map

How to harness information of the web

Newbie
 
Join Date: Oct 2008
Posts: 15
#1: Oct 21 '08
Hello Everyone,

I am not sure if I posting this to the right forum or not. So, I apologize before hand if this is not the forum for posting this question.

I want a script that would run weather in Windows or Linux that will gather the information of a website and save it in a file (maybe to a .xls file). I want to use a program because I want to search more than 1000s of pages. However, the good thing is that each page is identical to the other. For example, the program browses: http://www.xxxxxx.yyy/1.html and grabs a variable's content from inside and saves it to a file. Next it goes to: http://www.xxxxxx.yyy/2.html and does the same thing.

Can PERL do this?

Thanks

Icecrack's Avatar
Expert
 
Join Date: Sep 2008
Location: Sydney, Australia
Posts: 173
#2: Oct 21 '08

re: How to harness information of the web


simple answer yes, and you must attempt this on your own before we can help you, if you would like us to show you the right direction in learning perl we can.
KevinADC's Avatar
Expert
 
Join Date: Jan 2007
Location: Southern California USA
Posts: 4,091
#3: Oct 21 '08

re: How to harness information of the web


What is weather? Is that a Windows application or a third party application? Does it fetch the webpages?
Newbie
 
Join Date: Oct 2008
Posts: 15
#4: Oct 22 '08

re: How to harness information of the web


"weather" is an excessive word in that sentence. Please ignore it and sorry for the confusion.
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 900
#5: Oct 22 '08

re: How to harness information of the web


scriptx,

When you have a general question for various programming languages, please post it in the Miscellaneous Questions Forum rather than posting your same question in 4 different programming forums.

Thank You,

Kevin
Moderator
Newbie
 
Join Date: Oct 2008
Posts: 15
#6: Oct 22 '08

re: How to harness information of the web


All right let's do this :) I know there would be a lot to learn and I have already done some reading on wikipedia. I know a bit of C so this shouldn't be too hard.

I am trying this and I get errors:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. print "Hello, world!\n";

This is running in CentOS environment and Perl 5.8.X is installed.

Thanks
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 900
#7: Oct 22 '08

re: How to harness information of the web


Are you trying to view this via web browser? If so, you must first print the proper headers.

Expand|Select|Wrap|Line Numbers
  1. #! /usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5.  
  6. print "Content-type:text/html\n\n";
  7. print 'Hello World';
I would suggest that you get or read the book "Learning Perl" or "Beginning Perl", both are a great resource for beginners.

Last, but not least. Always use the [code][/code] tags when posting code samples here at Bytes.com

--Kevin
Newbie
 
Join Date: Oct 2008
Posts: 15
#8: Oct 22 '08

re: How to harness information of the web


Thanks for the suggestions. I am simply trying to compile (is that possible with Perl?) foo.pl in CentOS. I tried: perlcc foo.pl and it fails. I am not using a web browser. I only need to do this in Linux environment.
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,572
#9: Oct 22 '08

re: How to harness information of the web


Quote:

Originally Posted by scriptx

Thanks for the suggestions. I am simply trying to compile (is that possible with Perl?) foo.pl in CentOS. I tried: perlcc foo.pl and it fails. I am not using a web browser. I only need to do this in Linux environment.

What is your need for compiling it? I have never used perlcc, but another you could try is perl2exe. Converting to binary would only really be needed if you are distributing the script to clients and don't want your code "stolen" or copied. If not, why do it?

Regards,

Jeff
Reply