no more global session

Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
2018-02-26 08:22:05 -05:00
parent d23ce77a6d
commit 2e4cc9d416
2 changed files with 5 additions and 5 deletions
+5 -3
View File
@@ -25,7 +25,9 @@ Make a GET request to 'python.org', using Requests:
.. code-block:: pycon
>>> from requests_html import session
>>> import requests_html
>>> session = requests_html.Session()
>>> r = session.get('https://python.org/')
Grab a list of all links on the page, asis (anchors excluded):
@@ -73,14 +75,14 @@ Select Elements within Elements:
>>> about.find('a')
[<Element 'a' href='/about/' title='' class=''>, <Element 'a' href='/about/apps/' title=''>, <Element 'a' href='/about/quotes/' title=''>, <Element 'a' href='/about/gettingstarted/' title=''>, <Element 'a' href='/about/help/' title=''>, <Element 'a' href='http://brochure.getpython.info/' title=''>]
Search for links within an element:
.. code-block:: pycon
>>> about.absolute_links
{'http://brochure.getpython.info/', 'https://www.python.org/about/gettingstarted/', 'https://www.python.org/about/', 'https://www.python.org/about/quotes/', 'https://www.python.org/about/help/', 'https://www.python.org/about/apps/'}
Search for text on the page:
-2
View File
@@ -202,5 +202,3 @@ class Session(requests.Session):
response.html = HTML(response=response)
return response
session = Session()