Render JavaScript to HTML in Python?

只谈情不闲聊 提交于 2019-12-04 13:01:30

Here is one solution, however I very much doubt I'll be able to find a public PaaS cloud which can run it:

import spynner

if __name__=='__main__':
    url = "http://angular.github.com/angular-phonecat/step-10/app/#/phones"
    browser = spynner.Browser()
    browser.create_webview(True)
    browser.load(url, load_timeout=60)
    print browser._get_html()
    # ^ Can pipe this to a file, POST it to my server or return it as a string
    browser.close()

Package: Spynner (on Github)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!