Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

 

Webscrape

A Web 'Screen Scraper' 

mailto:info@webscrape.com


Calling PageScrape from Perl

Perl is amazing, most everyday things that other languages normally have you jumping through fiery hoops to achieve can most likely be done in Perl very easily indeed.  If you don't have a Perl setup for windows check out ActiveState,  they have a great (free) Perl for windows.

This example gets a stock quote given its ticker symbol.

$url = 'moneycentral.msn.com/scripts/webquote.dll?iPage=lqd&Symbol=';
$regEx = 'real-time quotes.*(\d+\.\d+)<';
$program = 'pscrape.exe';

$ticker = $ARGV[0];

$Command = "$program  -i -u\"$url$ticker\"  -e\"$regEx\"";

if ($ticker)
{
  $result = `$Command`;
  print $result;
}
else
{
  print "Usage: quote.pl <tickerSymbol>\n";
}