1
$\begingroup$

I am getting the following error when trying to import XML:

text = URLFetch[
   "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=protein&id=8&retmode=xml"];

ImportString[text, {"XML", "XMLObject"}];

XML`Parser`XMLGetString::prserr: MalformedURLException: The URL used an unsupported protocol at Line: 2 Character: 106. >>

Any suggestions?

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Oct 14 '15 at 11:30
  • 1
    $\begingroup$ I receive no errors and your code works fine on my computer (MMA 10.2, Win7-64). If the problem persists on your end, you could also try using Import directly: Import["http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=protein&id=8&rettype=xml", "XML"] which seems to produce the same results. $\endgroup$ – MarcoB Oct 14 '15 at 13:43
  • $\begingroup$ Thanks Marco. It's strange, I am getting the same error. I actually made a little mistake in what I copy/pasted to you, it should be retmode instead of rettype: In[171]:= Import["eutils.ncbi.nlm.nih.gov/entrez/eutils/… During evaluation of In[171]:= XMLParserXMLGet::prserr: MalformedURLException: The URL used an unsupported protocol at Line: 2 Character: 99 in /var/folders/ll/cl5jhpqx40s__jv4_blwsq5h0000gn/T/m000009227691/efetch.fcgi. >> During evaluation of In[171]:= Import::fmterr: Cannot import data as XML format. >> $\endgroup$ – user1496710 Oct 14 '15 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.