diff --git a/docs/source/index.rst b/docs/source/index.rst index feb45aa..86182c7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -177,6 +177,27 @@ You can also use this library without Requests: >>> html.links {'https://httpbin.org'} +You can also render JavaScript pages without Requests: + +.. code-block:: pycon + + # ^^ proceeding from above ^^ + >>> script = """ + () => { + return { + width: document.documentElement.clientWidth, + height: document.documentElement.clientHeight, + deviceScaleFactor: window.devicePixelRatio, + } + } + """ + >>> val = html.render(script=script, reload=False) + + >>> print(val) + {'width': 800, 'height': 600, 'deviceScaleFactor': 1} + + >>> print(html.html) +
API Documentation =================