MCPcopy
hub / github.com/psf/requests-html / test_bare_js_eval

Function test_bare_js_eval

tests/test_requests_html.py:263–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

261
262@pytest.mark.render
263def test_bare_js_eval():
264 doc = """
265 <!DOCTYPE html>
266 <html>
267 <body>
268 <div id="replace">This gets replaced</div>
269
270 <script type="text/javascript">
271 document.getElementById("replace").innerHTML = "yolo";
272 </script>
273 </body>
274 </html>
275 """
276
277 html = HTML(html=doc)
278 html.render()
279
280 assert html.find('#replace', first=True).text == 'yolo'
281
282
283@pytest.mark.render

Callers

nothing calls this directly

Calls 3

renderMethod · 0.95
HTMLClass · 0.90
findMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…