Perl to initiate and parse web search results

Discussion in 'Perl Misc' started by NovasTaylor, Aug 15, 2005.

  1. NovasTaylor

    NovasTaylor Guest

    Hi folks,

    I am wondering if Perl can be used to help me search numerous online
    classified ads. Every week I want to search local papers across the US
    for classic cars for sale. I have a serious of URL's that I must not
    click on and then view the results. Is there any way I can use a Perl
    script to both execute the search and parse the results?

    here is an example URL that searches a paper in Virginia and returns
    (today) 7 results. Thanks in advance,

    NovasTaylor

    http://classifieds.dailyprogress.co...0&maxrec=10&date=TODAY,SUNDAY_BEFORE(TODAY)%2
     
    NovasTaylor, Aug 15, 2005
    #1
    1. Advertising

  2. NovasTaylor

    NovasTaylor Guest

    yes, that works like a charm! Thanks Jim. From my example, I would
    use the following to count the number of times "CHEV" appears in the
    Classifieds section of the newspaper I am searching:

    use LWP::Simple;

    my $catalog =
    get("http://classifieds.dailyprogress.com/classifieds-bin/classifieds?temp_type=detail&classification=transportation&tp=CHARLOTTESVILLE+VA&property=charlottesville+va&orderby=start_date:d&category_number=1490&maxrec=10&date=TODAY,SUNDAY_BEFORE(TODAY)%2");

    my $count = 0;
    $count++ while $catalog =~ m{CHEV}gi;
    print "$count\n";



    NovasTaylor
     
    NovasTaylor, Aug 16, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary Chambers

    Perl Hacker, Python Initiate

    Gary Chambers, Feb 2, 2011, in forum: Python
    Replies:
    11
    Views:
    659
    Jorgen Grahn
    Feb 3, 2011
  2. bob
    Replies:
    11
    Views:
    457
    Iain Chalmers
    Dec 9, 2003
  3. b wreath
    Replies:
    3
    Views:
    166
    Ben Morrow
    Jun 2, 2004
  4. VB
    Replies:
    3
    Views:
    154
    Gregory Toomey
    Feb 3, 2005
  5. Craig Keightley
    Replies:
    10
    Views:
    261
    Craig Keightley
    Jun 29, 2005
Loading...

Share This Page