in reply to Re: Perl https parser
in thread Perl https parser

Thank you for your replies. I am trying to get the content from a web page (which has XML feeds in RSS 1.0, 2.0 and atom) and pass it through a RSS Parser to extract data which is why i am using XML::RSS. Firstly i was not able to retrive the RSS feed from the https webpage but i am able to do so for http sites. If i dont set a proxy i am not able to get to http sites either. Secondly I tried to pass the rss parser to a http site (http://ww.cnn.com/) and got an error:
no element found at line 1, column 0, byte -1 at I:/Perl5.8.8.817/lib/XML/Parser.pm line 187
The code for XML::RSS is:
#!/usr/local/bin/perl $ENV{"HTTP_PROXY"} = "http://http-proxy:xx"; $ENV{"HTTP_PROXY_USER"} = "xxxx"; $ENV{"HTTP_PROXY_PASS"} = "xxxx"; use LWP::UserAgent; use XML::RSS; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET => 'http://www.cnn.com/'); $ua->env_proxy(); $ua->agent('Mozilla/5.0'); $res = $ua->request($req); if ($res->is_success) { #print ($res->content); printf "fetched %d bytes\n", length($res->content); } else { print "Error: " . $res->code . " " . $res->message; } my $rss = new XML::RSS; $rss->parse($content); #print "rss is $rss\n";
I have read that XML::RSS supports all forms of RSS feed, is that so?
I would appreciate any help i can get on building an RSS parser in perl for https sites.
Thank you, Akhila