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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.