title: Why isn't Ghost.py loading/running my Javascript?
body: <p>Ghost.py is supposed to run JS: <a href="http://jeanphix.me/Ghost.py/" rel="noreferrer">http://jeanphix.me/Ghost.py/</a></p>
  
  <p>require.js gets fetched over http, but as far as I can tell it doesn't get run, since "js/main.built" never gets fetched and none of its specified JS files get loaded. It all works perfectly in a real browser.</p>
  
  <pre><code>In [51]: ghost = Ghost(wait_timeout=60)
  
  In [52]: page, resources = ghost.open(url)
  
  In [53]: [r.url for r in resources]
  Out[53]: 
  [PyQt4.QtCore.QUrl(u'https://example.com/#consume/283e6571bcecf34143cbd60f35e0464b'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/ui.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/colorpicker.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/selectize.default.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/datepicker.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/site.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/jquery.fileupload-ui.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/style.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/bootstrap.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/css/redactor.css'),
   PyQt4.QtCore.QUrl(u'https://example.com/js/lib/require.js')]
  
  In [54]: ghost.con
  ghost.confirm  ghost.content  
  
  In [54]: ghost.content
  Out[54]: u'&lt;!DOCTYPE html&gt;&lt;html lang="en"&gt;&lt;head&gt;\n    &lt;meta charset="utf-8"&gt;\n    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt;\n    &lt;title&gt;Ving&lt;/title&gt;\n\n    &lt;link rel="stylesheet" href="css/ui.css"&gt;\n    &lt;link rel="stylesheet" href="css/bootstrap.css"&gt;\n    &lt;link rel="stylesheet" href="css/colorpicker.css"&gt;\n    &lt;link rel="stylesheet" href="css/redactor.css"&gt;\n    &lt;link rel="stylesheet" href="css/site.css"&gt;\n    &lt;link rel="stylesheet" href="css/selectize.default.css"&gt;\n    &lt;!-- My Bug fixes / overrides to work with real app --&gt;\n    &lt;link rel="stylesheet" href="css/style.css"&gt;\n    &lt;link rel="stylesheet" href="css/datepicker.css"&gt;\n    &lt;!-- Theme for uploader --&gt;\n    &lt;link rel="stylesheet" href="css/jquery.fileupload-ui.css"&gt;\n    &lt;!-- Shims for IE support  --&gt;\n    &lt;!--[if lte IE 8]&gt;\n      &lt;script src="js/lib/html5shiv.js"&gt;&lt;/script&gt;\n      &lt;script src="js/lib/r2d3.min.js" charset="utf-8"&gt;&lt;/script&gt;\n    &lt;![endif]--&gt;\n  &lt;/head&gt;\n\n  &lt;body&gt;\n    &lt;div id="wrapper"&gt;\n      &lt;header id="header" class="container"&gt;&lt;/header&gt;\n      &lt;div id="content" class="container"&gt;&lt;/div&gt;\n    &lt;/div&gt;\n    &lt;footer id="footer" class="container"&gt;&lt;/footer&gt;\n    &lt;div id="modal" class="modal modal-box hide fade"&gt;&lt;/div&gt;\n    &lt;script data-main="js/main.built" src="js/lib/require.js"&gt;&lt;/script&gt;\n\n  \n\n&lt;/body&gt;&lt;/html&gt;'
  
  In [55]:
  </code></pre>
  
  <p>I also tried loading "<a href="https://mail.google.com/" rel="noreferrer">https://mail.google.com/</a>":</p>
  
  <pre><code>In [7]: url='https://mail.google.com/'
  
  In [8]: ghost = Ghost(wait_timeout=60)
  
  In [9]: page, resources = ghost.open(url)
  
  In [10]: ghost.content
  Out[10]: u'&lt;html&gt;&lt;head&gt;&lt;meta http-equiv="Refresh" content="0;URL=https://mail.google.com/mail/"&gt;&lt;/head&gt;&lt;body&gt;&lt;script type="text/javascript" language="javascript"&gt;&lt;!--\nlocation.replace("https://mail.google.com/mail/")\n--&gt;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;'
  
  In [11]: 
  </code></pre>