Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable 'wget' to download the whole content of HTML with Javascript

I have a site which I want to download using Unix wget. If you look at the source code and content of the file it contain section called SUMMARY. However after issuing a wget command like this:

wget   -O downdloadedtext.txt  http://www.ncbi.nlm.nih.gov/IEB/Research/Acembly/av.cgi?db=mouse&c=gene&a=fiche&l=2610008E11Rik 

The content of the downdloadedtext.txt is incomplete and different with the source code of that site. For example it doesn't contain SUMMARY section. Is there a correct way to obtain the full content correctly?

The reason I ask this because I want to automate the download from different values in that HTML.

like image 866
neversaint Avatar asked Apr 14 '10 09:04

neversaint


2 Answers

You need to put the link inside quotes:

 wget -O downdloadedtext.txt  'http://www.ncbi.nlm.nih.gov/IEB/Research/Acembly/av.cgi?db=mouse&c=gene&a=fiche&l=2610008E11Rik'

This is because the & has a special meaning and will split the command into multiple commands.

like image 175
Tomas Avatar answered Nov 15 '22 05:11

Tomas


The & character has special meaning in shells. Quote the URI so you actually request the URI you want to request.

like image 23
Quentin Avatar answered Nov 15 '22 05:11

Quentin