Hello!

I'm having a problem with downloading XML from site. I'm having something like doi address from science articles, that redirect to site with article description. Then I've got easy form in html which after writing doi address and clicking accept send You to the feature which should download XML and then parsing to get some info. And this is fragment of code which should download and write xml to the file:

#the whole process of getting xml from site and giving it into + the string variable #my $dioaddress = "http://dx.doi.org/10.1016/j.nuclphysa.2015. +05.005"; # my $reqforxml = new HTTP::Request GET => $addressdio; # my $res = $userag->request($reqforxml); # my $content = $res->content; my $content = get("$addressdio"); # my $html = get("http://dx.doi.org/10.1007/s00601-015-1012-x") # or die "Couldn't fetch the Perl Cookbook's page."; # print "$html"; #opening the file to write string with xml open my $overwrite, '>', 'overwrite.xml' or die "error trying +to overwrite: $!"; #writing string with xml to the file say $overwrite "$content";

Commented lines with "HTTP::Request" works the same as this uncommented lines

When doi was redirecting to Science Direct article it worked cool, but after having doi which redirect to Link Springer the XML which i'm having is not full like this:

<!DOCTYPE html> <!--[if lt IE 7]> <html lang="en" class="no-js ie6 lt-ie9 lt-ie8"> <![ +endif]--> <!--[if IE 7]> <html lang="en" class="no-js ie7 lt-ie9 lt-ie8"> <![ +endif]--> <!--[if IE 8]> <html lang="en" class="no-js ie8 lt-ie9"> <![endif]- +-> <!--[if IE 9]> <html lang="en" class="no-js ie9"> <![endif]--> <!--[if gt IE 9]><!--> <html lang="en" class="no-js"

Or sometimes something like:

<!DOCTYPE html> <!--[if lt IE 7]> <html lang="en" class="no-js ie6 lt-ie9 lt-ie8"> <![ +endif]--> <!--[if IE 7]> <html lang="en" class="no-js ie7 lt-ie9 lt-ie8"> <![ +endif]--> <!--[if IE 8]> <html lang="en" class="no-js ie8 lt-ie9"> <![endif]- +-> <!--[if IE 9]> <html lang="en" class="no-js ie9"> <![endif]--> <!--[if gt IE 9]><!--> <html lang="en" class="no-js"> <!--<![endif]--> <head> <meta charset="UTF-8"/> <meta name="description" content=""/> <meta name="author" content=""/> <meta name="viewport" content="width=device-width, minimum-scale=1, +maximum-scale=1"/> <meta name="format-detection" content="telephone=no"/> <meta name="citation_publisher" content="Springer Vienna"/> <meta name="citation_title" content="Adiabatic Hyperspherical Analys +is of Realistic Nuclear Potentials"/> <meta name="citation_firstpage" content="1"/> <meta name="citation_lastpage" content="7"/> <meta name="citation_doi" content="10.1007/s00601-015-1012-x"/> <meta name="citation_language" content="en"/> <meta name="citation_abstract_html_url" content="http://link.springe +r.com/article/10.1007/s00601-015-1012-x"/> <meta name="citation_pdf_url" content="http://link.springer.com/cont +ent/pdf/10.1007%2Fs00601-015-1012-x.pdf"/> <meta name="citation_springer_api_url" content="http://api.springer. +com/metadata/pam?q=doi:SpringerId(10.1007/s00601-015-1012-x)&amp;api_ +key="/> <meta name="citation_author" content="K. M. Daily"/> <meta name="citation_author_institution" content="Purdue University" +/> <meta name="citation_author_email" content="daily5@purdue.edu"/> <meta name="citation_author" content="Alejandro Kievsky"/> <meta name="citation_author_institution" content="Instituto Nazional +e di Fisica Nucleare"/> <meta name="citation_author" content="Chris H. Greene"/> <meta name="citation_author_institution" content="Purdue University" +/> <meta name="citation_journal_title" content="Few-Body Systems"/> <meta name="citation_journal_abbrev" content="Few-Body Syst"/> <meta name="citation_issn" content="0177-7963"/> <meta name="citation_issn" content="1432-5411"/> <meta name="citation_online_date" content="2015/06/26"/> <m

Like You can see, it stops getting xml in one moment :/. Can someone tell me what is wrong, or what I'm doing wrong? Like I said Doi redirected to Science Direct worked pretty well


In reply to Getting XML from DOI address by hooel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.