Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download a local copy of a site with mathjax with wget?

Tags:

wget

I can download a local version of a site using command like:

wget -p -k -H -E -r -nc --no-parent https://www.example.com

However, unlike when I locally save a page from firefox via ctrl + s, the wget version above doesn't render MathJax.

How can I download files locally such that mathJax parts are rendered properly?

EDIT:

These resides in the of example page:

<link href="https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css" rel="stylesheet" type="text/css"/>

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

<script>documenterBaseURL="."</script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.2.0/require.min.js" data-main="assets/documenter.js"></script>

<script src="siteinfo.js"></script>

<script src="../versions.js"></script>

<link href="assets/highlightjs/default.css" rel="stylesheet" type="text/css"/><link href="assets/documenter.css" rel="stylesheet" type="text/css"/>
like image 392
Robert C. Holland Avatar asked May 21 '17 18:05

Robert C. Holland


1 Answers

Try this:

wget -E -H -k -K -p http://www.website.com

If it does not work, you might need a second run of wget to retrieve the missing files from the website using the -i flag to lists all the URL's and match to see if you missed one.

Reference:

https://www.gnu.org/software/wget/manual/wget.html#Recursive-Retrieval-Options

like image 172
Roberto Gonçalves Avatar answered Dec 09 '22 08:12

Roberto Gonçalves