Firefox was loading very slow, so I decided to use wget
to save HTML files.I used the following command,
wget http://textbook.s-anand.net/ncert/class-xii/chemistry/hello-this-first-chapter
The files have been saved in my home folder.But I don't know where the images are stored.I need them to use in Anki
.
So where are the images stored?
I prefer to use
--page-requisites
(-p
for short) instead of-r
here as it downloads everything the page needs to display but no other pages, and I don't have to think about what kind of files I want.Actually I'm usually using something like
This means:
-E
: Append.html
to the file name if it is an HTML file but doesn't end in.html
or similar-H
: Download files from other hosts, too-k
: After downloading convert any link in it so they point to the downloaded files-p
: Download anything the page needs for proper offline viewingusing the -r parameter should enable wget to download the whole folder, including your images.
Downloading the image files separately as well
I think this command could get you started.
It allows you to specify the location to save the images and which types of files you wants. Maybe downloading the images as such is easier.
Source:
Copying the image files from your folder
I have noticed that the website uses PNG image files. You can just copy those from your folder. This should be run in the folder where you stored the webpage.
wget
simply downloads the HTML file of the page, not the images in the page, as the images in the HTML file of the page are written as URLs. To do what you want, use the-r
(recursive), the-A
option with the image file suffixes, the--no-parent
option, to make it not ascend, and the--level
option with1
.Specifically
wget -r -A .jpg,.png,.gif --no-parent --level <url>
Even better, most browsers have methods for saving pages for offline viewing.