Hi
Thanks for the tip. I was able to figure that out the hard way by carefully seeing where by browser was going. I didnt know about the META tag. I am now able to download the file
'https://secure2.playboy.com/security/cookieGenerator.do'
Once again this file is a redirect to
https://secure2.spicetv.com/security/cookieGenerator.do
but with a lot of cookie information added at the end. So I am trying to get the value of the "content" attribute of the "meta" tag.
I am now trying to parse the html file using HTML::TokeParserL::Simple. The trouble is the html file has the first few lines as the new line character and each line after that has a new line character. The HTML::TokerParser::Simple is choking on the malformed (??) html. So I am trying to remove the lines which have only a new line character (^M) and remove the ^M at the end of each line. Since this is my first time with perl I am struggling with this simple task.
Any help or code sample to strip off lines with only a new line character and the new line character at the end of each line is appreciated. I am trying to use chomp but dont know how to loop through the entire output of mech->content
If I clean up the html file by hand and then run the following script
my $p = HTML::TokeParser::Simple->new( $html );
my $token = $p->get_token;
my $tag = "meta";
my $att = "content";
if ( $token->is_tag($tag) ) { print "There is a $tag tag\n" };
my $att_value = $token->get_attr($att);
print "The value of the $att attribute of the $tag tag is $att_value \
+n\n\n\n";
my $url = substr($att_value,6);
print $url,"\n";
Iam able to get the info I need but cleaning up the html file is the problem
Thanks