revendar has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, I'm trying to scrap a flash enabled website(http://concerts.livenation.com/event/04004B76DB4C779A?tm_link=search_msg-0_04004B76DB4C779A&crosssite=TM_US:735415:32837).Hera I'm trying to get the availability of seats from flash screen. I have found http link which the flash app uses using MozRepl in firefox. But a part of xml which I get is encrypted. Is it due to gzip format?? I'm pasting the code here. Please enlighten me. Thanks
#!C:\Perl\bin\perl use LWP::UserAgent; use strict; use Data::Dumper; use Date::Simple qw/ date today /; use XML::SImple; use Compress::Zlib; local $SIG{__WARN__} = sub { }; my $ua = LWP::UserAgent->new; $ua->agent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/201004 +01 Firefox/3.6.3 (FM Scene 4.6.1)" ); my $xs = XML::Simple->new(); my $url = "http://concerts.livenation.com/app/availability/04004B76DB4 +C779A"; my $response = $ua->get($url); if ( $response->is_success ) { print $response->decoded_content; my $ref = $xs->XMLin( $response->decoded_content ); #open FILE, ">f.gz"; # binmode(FILE); # print FILE $ref->{ev_comp}; # or whatever # close FILE; print Compress::Zlib::memGunzip($ref->{ev_comp}); } else { #die $response->status_line; print "\t[FAILURE]\n"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: scraping flash content
by GrandFather (Saint) on Dec 17, 2013 at 23:56 UTC | |
Re: scraping flash content
by davido (Cardinal) on Dec 18, 2013 at 00:31 UTC | |
Re: scraping flash content
by Anonymous Monk on Dec 18, 2013 at 05:46 UTC |
Back to
Seekers of Perl Wisdom