smandape1 has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks, Here I am again to get some help and enhance my knowledge and skills. I am trying to extract data from web using Connotea perl API. Connotea is an online reference library maintained by Nature, one of the known names in the field of life-sciences. It is a free-site. Users maintain their online reference library on connotea and I am trying to get the user information who have tagged their reference libraries which also includes the information about the references. Connotea provides perl API. While extracting the data I get this error
Invalid content type in response: text/html at mycode line 41of the code
while (<IN0>) { my $currentURI = $_; chomp($currentURI); my @tags = $c->posts_for(uri =>"$currentURI");
line 41 is the one that starts with my @tags. And where $currentURI comes from the list of uris I have and for which I am trying to get the information which is in the form of posts_for (this is coming from connotea perl API). This is in loop. I am using active perl 5.12.3. I learned from one of the experts that connotea only accepts RDF MIME types, i.e., application/xml or application/rdf+xml. text/html isn't either, and that is where your error comes from. In this case, the server is saying the content isn't RDF (as it isn't XML). Also one of the experts suggested me to use eval{} around virtually all connotea perl code. I tried but I don't understand how to deal with this. I hope I am a bit clear about my question. Help me monks. I greatly appreciate your help. Thank you, Sammed
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error handling
by ikegami (Patriarch) on Jul 18, 2011 at 17:31 UTC | |
by smandape1 (Acolyte) on Jul 18, 2011 at 18:57 UTC | |
by ikegami (Patriarch) on Jul 18, 2011 at 19:45 UTC | |
by smandape1 (Acolyte) on Jul 18, 2011 at 19:57 UTC | |
by ikegami (Patriarch) on Jul 18, 2011 at 20:20 UTC | |
|