Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Do you know where your variables are?
 
PerlMonks  

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?


Comment on Re: Web Scraping on CGI Scripts?
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 = "http://www.molmovdb.org/cgi-bin/browse.cgi"; # 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://930489]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-04-19 16:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls