diff --git a/README.rst b/README.rst index 41f3491..b95f34f 100644 --- a/README.rst +++ b/README.rst @@ -9,6 +9,7 @@ simple and intuitive as possible. When using this library you automatically get: +- Optional JavaScript support! - CSS Selectors (a.k.a jQuery-style, thanks to PyQuery). - XPath Selectors, for the faint at heart. - Mocked user-agent (like a real web browser). @@ -71,14 +72,14 @@ Introspect an Element's attributes: >>> about.attrs {'id': 'about', 'class': ('tier-1', 'element-1'), 'aria-haspopup': 'true'} - + Render out an Element's HTML: .. code-block:: pycon >>> about.html '
  • \nAbout\n\n
  • ' - + Select Elements within Elements: @@ -120,6 +121,21 @@ XPath is also supported: >>> r.html.xpath('a') [] +JavaScript Support +================== + +Let's grab some text that's rendered by JavaScript: + +.. code-block:: pycon + + >>> from requests_html import BrowserSession + >>> session = BrowserSession() + + >>> r = session.get('http://python-requests.org') + >>> r.html.search('Python 2 will retire in only {months} months!')['months'] + '' + + Using without Requests ======================