title: How to mirror a site with a JavaScript menu?
body: <p>I’m trying to mirror a site that uses a crazy JavaScript menu generated on the client. Both <code>wget</code> and <code>httrack</code> fail to download the whole site, because the links are simply not there until the JS code runs. What can I do?</p>
  
  <p>I have tried loading the main index page into the browser. That runs the JS code, the menu gets constructed and I can dump the resulting DOM into an HTML file &amp; mirror from this file on. That downloads more files, as the links are already in the source. But obviously the mirroring soon breaks on other, freshly downloaded pages that contain the uninterpreted JS menu.</p>
  
  <p>I thought about replacing the menu part of every downloaded page with a static version of the menu, but I can’t find any <code>wget</code> or <code>httrack</code> flags that would let me run the downloaded files through an external command. I could write a simple filtering proxy, but that starts to sound extreme. Other ideas?</p>