How to harness information of the web

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scriptx
    New Member
    • Oct 2008
    • 15

    How to harness information of the web

    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
    Recognized Expert New Member
    • Sep 2008
    • 174

    #2
    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.

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      What is weather? Is that a Windows application or a third party application? Does it fetch the webpages?

      Comment

      • scriptx
        New Member
        • Oct 2008
        • 15

        #4
        "weather" is an excessive word in that sentence. Please ignore it and sorry for the confusion.

        Comment

        • eWish
          Recognized Expert Contributor
          • Jul 2007
          • 973

          #5
          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

          Comment

          • scriptx
            New Member
            • Oct 2008
            • 15

            #6
            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:

            Code:
            #!/usr/bin/perl
            print "Hello, world!\n";

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

            Thanks
            Last edited by eWish; Oct 22 '08, 01:02 AM. Reason: Please use code tags.

            Comment

            • eWish
              Recognized Expert Contributor
              • Jul 2007
              • 973

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

              Code:
              #! /usr/bin/perl
              
              use strict;
              use warnings;
              
              print "Content-type:text/html\n\n";
              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

              Comment

              • scriptx
                New Member
                • Oct 2008
                • 15

                #8
                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.

                Comment

                • numberwhun
                  Recognized Expert Moderator Specialist
                  • May 2007
                  • 3467

                  #9
                  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

                  Comment

                  Working...