How to load an XML webpage using Wget

I want to download XML from the web using Unix wget . Basically, just get it and save it to a file.

This is the command I use:

 wget http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Alum+AND+Adjuvant&retmax=100 --output-document=test.xml 

But if it failed to load. What is the right way?

+6
source share
3 answers

You must provide a url like

  wget "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Alum+AND+Adjuvant&retmax=100" --output-document=test.xml 

since url contains metacharacters that affect string processing.

+13
source
  wget --output-document=test.xml "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Alum+AND+Adjuvant&retmax=100" 
0
source

if --Output-document does not work, you can use -O

 wget -O test.xml "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Alum+AND+Adjuvant&retmax=100" 
0
source

All Articles