Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Web Scraping on CGI Scripts?

by Corion (Pope)
on Oct 09, 2011 at 19:49 UTC ( #930489=note: print w/replies, xml ) Need Help??

in reply to Web Scraping on CGI Scripts?

Do you have access to the web server machine itself?

If you are talking about web scraping, it behooves you well to understand where HTML files and CGI files, and also from which point on there is no difference between the two.

Personally, I use WWW::Mechanize, or Web::Scraper, or App::scrape. Others have reported good success using Mojolicious. Which one of these have you tried and how did they fail for you?

Replies are listed 'Best First'.
Re^2: Web Scraping on CGI Scripts?
by fraizerangus (Sexton) on Oct 10, 2011 at 08:38 UTC
    Hi Corion

    Unfortunately I don't have access to the server machine itself, I'm doing it over the internet entirely. I've been using Web::Scraper which works really well with properly formatted HTML but not with CGI. I'm trying to get the URL and name of entries in the table. For example the code I've been using is:

    #!/usr/bin/perl use warnings; use strict; use URI; use Web::Scraper; open FILE, ">file.txt" or die $!; # website to scrape my $urlToScrape = ""; # prepare data my $teamsdata = scraper { # we will save the urls from the teams process "tr.cell2> A", 'urls[]' => '@href'; # we will save the team names process "tr.cell2> A", 'teams[]' => 'TEXT'; }; # scrape the data my $res = $teamsdata->scrape(URI->new($urlToScrape));

    Please follow the link given in the code and open its page source for an example? best wishes Dan

      There is no conceptual difference between "CGI" and "HTML" when they are accessed over HTTP. If Web::Scraper fails, maybe you can tell us how it fails and where.

        Web::Scraper does'nt seem to recgnise the <> tagging in the CGI scripts in the same way as the HTML, if you run the same code on HTML it works but on CGI it can't recognize and process it?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930489]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2018-06-20 17:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.