requests-html: Render w/o request doesn't execute inline JS
This lib looks great, thanks 😃… Just a note, I was expecting:
doc = """<a href='https://httpbin.org'>"""
html = HTML(html=doc)
html.render()
html.html
to output : <a href='https://httpbin.org'>
Instead I get the content from example.org, which is the default url.
How can I set the html content and then render it? I can’t seem to pass it to:
doc = """<a href='https://httpbin.org'>"""
html = HTML(html=doc)
html.render(script=doc)
html.html
either, as I get an:
BrowserError: Evaluation failed: SyntaxError: Unexpected token <
pageFunction:
<a href='https://httpbin.org'>
I could set the url to the local file and patch it in, but that solution seems lacking.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16
Commits related to this issue
- much better approach to #57 Signed-off-by: Kenneth Reitz <me@kennethreitz.org> — committed to psf/requests-html by kennethreitz 6 years ago
the following now works: