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

Function test_bare_js_async_eval

tests/test_requests_html.py:285–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283@pytest.mark.render
284@pytest.mark.asyncio
285async def test_bare_js_async_eval():
286 doc = """
287 <!DOCTYPE html>
288 <html>
289 <body>
290 <div id="replace">This gets replaced</div>
291
292 <script type="text/javascript">
293 document.getElementById("replace").innerHTML = "yolo";
294 </script>
295 </body>
296 </html>
297 """
298
299 html = HTML(html=doc, async_=True)
300 await html.arender()
301
302 assert html.find('#replace', first=True).text == 'yolo'
303 await html.browser.close()
304
305
306@pytest.mark.ok

Callers

nothing calls this directly

Calls 4

arenderMethod · 0.95
HTMLClass · 0.90
findMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…