[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-70745":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":37,"discoverSource":38},70745,"requests-html","psf\u002Frequests-html","psf","Pythonic HTML Parsing for Humans™","http:\u002F\u002Fhtml.python-requests.org",null,"Python",13828,1000,260,200,0,2,44,"MIT License",false,"master",true,[24,25,26,27,28,29,30,31,32,33],"beautifulsoup","css-selectors","html","http","kennethreitz","lxml","pyquery","python","requests","scraping","2026-06-12 02:02:42","Requests-HTML: HTML Parsing for Humans™\n=======================================\n\n.. image:: https:\u002F\u002Ffarm5.staticflickr.com\u002F4695\u002F39152770914_a3ab8af40d_k_d.jpg\n\n.. image:: https:\u002F\u002Ftravis-ci.com\u002Fpsf\u002Frequests-html.svg?branch=master\n    :target: https:\u002F\u002Ftravis-ci.com\u002Fpsf\u002Frequests-html\n\nThis library intends to make parsing HTML (e.g. scraping the web) as\nsimple and intuitive as possible.\n\nWhen using this library you automatically get:\n\n- **Full JavaScript support**! (Using Chromium, thanks to pyppeteer)\n- *CSS Selectors* (a.k.a jQuery-style, thanks to PyQuery).\n- *XPath Selectors*, for the faint of heart.\n- Mocked user-agent (like a real web browser).\n- Automatic following of redirects.\n- Connection–pooling and cookie persistence.\n- The Requests experience you know and love, with magical parsing abilities.\n- **Async Support**\n\n.. Other nice features include:\n\n    - Markdown export of pages and elements.\n\n\nTutorial & Usage\n================\n\nMake a GET request to 'python.org', using Requests:\n\n.. code-block:: pycon\n\n    >>> from requests_html import HTMLSession\n    >>> session = HTMLSession()\n    >>> r = session.get('https:\u002F\u002Fpython.org\u002F')\n\nTry async and get some sites at the same time:\n\n.. code-block:: pycon\n\n    >>> from requests_html import AsyncHTMLSession\n    >>> asession = AsyncHTMLSession()\n    >>> async def get_pythonorg():\n    ...     r = await asession.get('https:\u002F\u002Fpython.org\u002F')\n    ...     return r\n    ...\n    >>> async def get_reddit():\n    ...    r = await asession.get('https:\u002F\u002Freddit.com\u002F')\n    ...    return r\n    ...\n    >>> async def get_google():\n    ...    r = await asession.get('https:\u002F\u002Fgoogle.com\u002F')\n    ...    return r\n    ...\n    >>> results = asession.run(get_pythonorg, get_reddit, get_google)\n    >>> results # check the requests all returned a 200 (success) code\n    [\u003CResponse [200]>, \u003CResponse [200]>, \u003CResponse [200]>]\n    >>> # Each item in the results list is a response object and can be interacted with as such\n    >>> for result in results: \n    ...     print(result.html.url)\n    ... \n    https:\u002F\u002Fwww.python.org\u002F\n    https:\u002F\u002Fwww.google.com\u002F\n    https:\u002F\u002Fwww.reddit.com\u002F\n\nNote that the order of the objects in the results list represents the order they were returned in, not the order that the coroutines are passed to the ``run`` method, which is shown in the example by the order being different. \n\nGrab a list of all links on the page, as–is (anchors excluded):\n\n.. code-block:: pycon\n\n    >>> r.html.links\n    {'\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002F', '\u002Fabout\u002Fapps\u002F', 'https:\u002F\u002Fgithub.com\u002Fpython\u002Fpythondotorg\u002Fissues', '\u002Faccounts\u002Flogin\u002F', '\u002Fdev\u002Fpeps\u002F', '\u002Fabout\u002Flegal\u002F', '\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fintroduction.html#lists', '\u002Fdownload\u002Falternatives', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002Fkihd2DW98YY\u002Fpython-370a4-is-available-for-testing.html', '\u002Fdownload\u002Fother\u002F', '\u002Fdownloads\u002Fwindows\u002F', 'https:\u002F\u002Fmail.python.org\u002Fmailman\u002Flistinfo\u002Fpython-dev', '\u002Fdoc\u002Fav', 'https:\u002F\u002Fdevguide.python.org\u002F', '\u002Fabout\u002Fsuccess\u002F#engineering', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FPythonEventsCalendar#Submitting_an_Event', 'https:\u002F\u002Fwww.openstack.org', '\u002Fabout\u002Fgettingstarted\u002F', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002FAMoBel8b8Mc\u002Fpython-3.html', '\u002Fsuccess-stories\u002Findustrial-light-magic-runs-python\u002F', 'http:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fintroduction.html#using-python-as-a-calculator', '\u002F', 'http:\u002F\u002Fpyfound.blogspot.com\u002F', '\u002Fevents\u002Fpython-events\u002Fpast\u002F', '\u002Fdownloads\u002Frelease\u002Fpython-2714\u002F', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FPythonBooks', 'http:\u002F\u002Fplus.google.com\u002F+Python', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002F', 'https:\u002F\u002Fstatus.python.org\u002F', '\u002Fcommunity\u002Fworkshops\u002F', '\u002Fcommunity\u002Flists\u002F', 'http:\u002F\u002Fbuildbot.net\u002F', '\u002Fcommunity\u002Fawards', 'http:\u002F\u002Ftwitter.com\u002FThePSF', 'https:\u002F\u002Fdocs.python.org\u002F3\u002Flicense.html', '\u002Fpsf\u002Fdonations\u002F', 'http:\u002F\u002Fwiki.python.org\u002Fmoin\u002FLanguages', '\u002Fdev\u002F', '\u002Fevents\u002Fpython-user-group\u002F', 'https:\u002F\u002Fwiki.qt.io\u002FPySide', '\u002Fcommunity\u002Fsigs\u002F', 'https:\u002F\u002Fwiki.gnome.org\u002FProjects\u002FPyGObject', 'http:\u002F\u002Fwww.ansible.com', 'http:\u002F\u002Fwww.saltstack.com', 'http:\u002F\u002Fplanetpython.org\u002F', '\u002Fevents\u002Fpython-events', '\u002Fabout\u002Fhelp\u002F', '\u002Fevents\u002Fpython-user-group\u002Fpast\u002F', '\u002Fabout\u002Fsuccess\u002F', '\u002Fpsf-landing\u002F', '\u002Fabout\u002Fapps', '\u002Fabout\u002F', 'http:\u002F\u002Fwww.wxpython.org\u002F', '\u002Fevents\u002Fpython-user-group\u002F665\u002F', 'https:\u002F\u002Fwww.python.org\u002Fpsf\u002Fcodeofconduct\u002F', '\u002Fdev\u002Fpeps\u002Fpeps.rss', '\u002Fdownloads\u002Fsource\u002F', '\u002Fpsf\u002Fsponsorship\u002Fsponsors\u002F', 'http:\u002F\u002Fbottlepy.org', 'http:\u002F\u002Froundup.sourceforge.net\u002F', 'http:\u002F\u002Fpandas.pydata.org\u002F', 'http:\u002F\u002Fbrochure.getpython.info\u002F', 'https:\u002F\u002Fbugs.python.org\u002F', '\u002Fcommunity\u002Fmerchandise\u002F', 'http:\u002F\u002Ftornadoweb.org', '\u002Fevents\u002Fpython-user-group\u002F650\u002F', 'http:\u002F\u002Fflask.pocoo.org\u002F', '\u002Fdownloads\u002Frelease\u002Fpython-364\u002F', '\u002Fevents\u002Fpython-user-group\u002F660\u002F', '\u002Fevents\u002Fpython-user-group\u002F638\u002F', '\u002Fpsf\u002F', '\u002Fdoc\u002F', 'http:\u002F\u002Fblog.python.org', '\u002Fevents\u002Fpython-events\u002F604\u002F', '\u002Fabout\u002Fsuccess\u002F#government', 'http:\u002F\u002Fpython.org\u002Fdev\u002Fpeps\u002F', 'https:\u002F\u002Fdocs.python.org', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002FzVC80sq9s00\u002Fpython-364-is-now-available.html', '\u002Fusers\u002Fmembership\u002F', '\u002Fabout\u002Fsuccess\u002F#arts', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FPython2orPython3', '\u002Fdownloads\u002F', '\u002Fjobs\u002F', 'http:\u002F\u002Ftrac.edgewall.org\u002F', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002Fwh73_1A-N7Q\u002Fpython-355rc1-and-python-348rc1-are-now.html', '\u002Fprivacy\u002F', 'https:\u002F\u002Fpypi.python.org\u002F', 'http:\u002F\u002Fwww.riverbankcomputing.co.uk\u002Fsoftware\u002Fpyqt\u002Fintro', 'http:\u002F\u002Fwww.scipy.org', '\u002Fcommunity\u002Fforums\u002F', '\u002Fabout\u002Fsuccess\u002F#scientific', '\u002Fabout\u002Fsuccess\u002F#software-development', '\u002Fshell\u002F', '\u002Faccounts\u002Fsignup\u002F', 'http:\u002F\u002Fwww.facebook.com\u002Fpythonlang?fref=ts', '\u002Fcommunity\u002F', 'https:\u002F\u002Fkivy.org\u002F', '\u002Fabout\u002Fquotes\u002F', 'http:\u002F\u002Fwww.web2py.com\u002F', '\u002Fcommunity\u002Flogos\u002F', '\u002Fcommunity\u002Fdiversity\u002F', '\u002Fevents\u002Fcalendars\u002F', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FBeginnersGuide', '\u002Fsuccess-stories\u002F', '\u002Fdoc\u002Fessays\u002F', '\u002Fdev\u002Fcore-mentorship\u002F', 'http:\u002F\u002Fipython.org', '\u002Fevents\u002F', '\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fcontrolflow.html', '\u002Fabout\u002Fsuccess\u002F#education', '\u002Fblogs\u002F', '\u002Fcommunity\u002Firc\u002F', 'http:\u002F\u002Fpycon.blogspot.com\u002F', '\u002F\u002Fjobs.python.org', 'http:\u002F\u002Fwww.pylonsproject.org\u002F', 'http:\u002F\u002Fwww.djangoproject.com\u002F', '\u002Fdownloads\u002Fmac-osx\u002F', '\u002Fabout\u002Fsuccess\u002F#business', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002Fx_c9D0S-4C4\u002Fpython-370b1-is-now-available-for.html', 'http:\u002F\u002Fwiki.python.org\u002Fmoin\u002FTkInter', 'https:\u002F\u002Fdocs.python.org\u002Ffaq\u002F', '\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fcontrolflow.html#defining-functions'}\n\nGrab a list of all links on the page, in absolute form (anchors excluded):\n\n.. code-block:: pycon\n\n    >>> r.html.absolute_links\n    {'https:\u002F\u002Fgithub.com\u002Fpython\u002Fpythondotorg\u002Fissues', 'https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002Fkihd2DW98YY\u002Fpython-370a4-is-available-for-testing.html', 'https:\u002F\u002Fwww.python.org\u002Fdev\u002Fpeps\u002F', 'https:\u002F\u002Fmail.python.org\u002Fmailman\u002Flistinfo\u002Fpython-dev', 'https:\u002F\u002Fwww.python.org\u002Fdoc\u002F', 'https:\u002F\u002Fwww.python.org\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-events\u002Fpast\u002F', 'https:\u002F\u002Fdevguide.python.org\u002F', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FPythonEventsCalendar#Submitting_an_Event', 'https:\u002F\u002Fwww.openstack.org', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002FAMoBel8b8Mc\u002Fpython-3.html', 'https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fintroduction.html#lists', 'http:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fintroduction.html#using-python-as-a-calculator', 'http:\u002F\u002Fpyfound.blogspot.com\u002F', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FPythonBooks', 'http:\u002F\u002Fplus.google.com\u002F+Python', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-events', 'https:\u002F\u002Fstatus.python.org\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fapps', 'https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-2714\u002F', 'https:\u002F\u002Fwww.python.org\u002Fpsf\u002Fdonations\u002F', 'http:\u002F\u002Fbuildbot.net\u002F', 'http:\u002F\u002Ftwitter.com\u002FThePSF', 'https:\u002F\u002Fdocs.python.org\u002F3\u002Flicense.html', 'http:\u002F\u002Fwiki.python.org\u002Fmoin\u002FLanguages', 'https:\u002F\u002Fdocs.python.org\u002Ffaq\u002F', 'https:\u002F\u002Fjobs.python.org', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F#software-development', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F#education', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Flogos\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdoc\u002Fav', 'https:\u002F\u002Fwiki.qt.io\u002FPySide', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-user-group\u002F660\u002F', 'https:\u002F\u002Fwiki.gnome.org\u002FProjects\u002FPyGObject', 'http:\u002F\u002Fwww.ansible.com', 'http:\u002F\u002Fwww.saltstack.com', 'https:\u002F\u002Fwww.python.org\u002Fdev\u002Fpeps\u002Fpeps.rss', 'http:\u002F\u002Fplanetpython.org\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-user-group\u002Fpast\u002F', 'https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fcontrolflow.html#defining-functions', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Fdiversity\u002F', 'https:\u002F\u002Fdocs.python.org\u002F3\u002Ftutorial\u002Fcontrolflow.html', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Fawards', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-user-group\u002F638\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Flegal\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdev\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdownload\u002Falternatives', 'https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Flists\u002F', 'http:\u002F\u002Fwww.wxpython.org\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F#government', 'https:\u002F\u002Fwww.python.org\u002Fpsf\u002F', 'https:\u002F\u002Fwww.python.org\u002Fpsf\u002Fcodeofconduct\u002F', 'http:\u002F\u002Fbottlepy.org', 'http:\u002F\u002Froundup.sourceforge.net\u002F', 'http:\u002F\u002Fpandas.pydata.org\u002F', 'http:\u002F\u002Fbrochure.getpython.info\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Fsource\u002F', 'https:\u002F\u002Fbugs.python.org\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Fmac-osx\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fhelp\u002F', 'http:\u002F\u002Ftornadoweb.org', 'http:\u002F\u002Fflask.pocoo.org\u002F', 'https:\u002F\u002Fwww.python.org\u002Fusers\u002Fmembership\u002F', 'http:\u002F\u002Fblog.python.org', 'https:\u002F\u002Fwww.python.org\u002Fprivacy\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fgettingstarted\u002F', 'http:\u002F\u002Fpython.org\u002Fdev\u002Fpeps\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fapps\u002F', 'https:\u002F\u002Fdocs.python.org', 'https:\u002F\u002Fwww.python.org\u002Fsuccess-stories\u002F', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Fforums\u002F', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002FzVC80sq9s00\u002Fpython-364-is-now-available.html', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Fmerchandise\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F#arts', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FPython2orPython3', 'http:\u002F\u002Ftrac.edgewall.org\u002F', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002Fwh73_1A-N7Q\u002Fpython-355rc1-and-python-348rc1-are-now.html', 'https:\u002F\u002Fpypi.python.org\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-user-group\u002F650\u002F', 'http:\u002F\u002Fwww.riverbankcomputing.co.uk\u002Fsoftware\u002Fpyqt\u002Fintro', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fquotes\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Fwindows\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fcalendars\u002F', 'http:\u002F\u002Fwww.scipy.org', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Fworkshops\u002F', 'https:\u002F\u002Fwww.python.org\u002Fblogs\u002F', 'https:\u002F\u002Fwww.python.org\u002Faccounts\u002Fsignup\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002F', 'https:\u002F\u002Fkivy.org\u002F', 'http:\u002F\u002Fwww.facebook.com\u002Fpythonlang?fref=ts', 'http:\u002F\u002Fwww.web2py.com\u002F', 'https:\u002F\u002Fwww.python.org\u002Fpsf\u002Fsponsorship\u002Fsponsors\u002F', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdownload\u002Fother\u002F', 'https:\u002F\u002Fwww.python.org\u002Fpsf-landing\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-user-group\u002F665\u002F', 'https:\u002F\u002Fwiki.python.org\u002Fmoin\u002FBeginnersGuide', 'https:\u002F\u002Fwww.python.org\u002Faccounts\u002Flogin\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdownloads\u002Frelease\u002Fpython-364\u002F', 'https:\u002F\u002Fwww.python.org\u002Fdev\u002Fcore-mentorship\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F#business', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Fsigs\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-user-group\u002F', 'http:\u002F\u002Fipython.org', 'https:\u002F\u002Fwww.python.org\u002Fshell\u002F', 'https:\u002F\u002Fwww.python.org\u002Fcommunity\u002Firc\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F#engineering', 'http:\u002F\u002Fwww.pylonsproject.org\u002F', 'http:\u002F\u002Fpycon.blogspot.com\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fsuccess\u002F#scientific', 'https:\u002F\u002Fwww.python.org\u002Fdoc\u002Fessays\u002F', 'http:\u002F\u002Fwww.djangoproject.com\u002F', 'https:\u002F\u002Fwww.python.org\u002Fsuccess-stories\u002Findustrial-light-magic-runs-python\u002F', 'http:\u002F\u002Ffeedproxy.google.com\u002F~r\u002FPythonInsider\u002F~3\u002Fx_c9D0S-4C4\u002Fpython-370b1-is-now-available-for.html', 'http:\u002F\u002Fwiki.python.org\u002Fmoin\u002FTkInter', 'https:\u002F\u002Fwww.python.org\u002Fjobs\u002F', 'https:\u002F\u002Fwww.python.org\u002Fevents\u002Fpython-events\u002F604\u002F'}\n\nSelect an element with a CSS Selector:\n\n.. code-block:: pycon\n\n    >>> about = r.html.find('#about', first=True)\n\nGrab an element's text contents:\n\n.. code-block:: pycon\n\n    >>> print(about.text)\n    About\n    Applications\n    Quotes\n    Getting Started\n    Help\n    Python Brochure\n\nIntrospect an Element's attributes:\n\n.. code-block:: pycon\n\n    >>> about.attrs\n    {'id': 'about', 'class': ('tier-1', 'element-1'), 'aria-haspopup': 'true'}\n\nRender out an Element's HTML:\n\n.. code-block:: pycon\n\n    >>> about.html\n    '\u003Cli aria-haspopup=\"true\" class=\"tier-1 element-1 \" id=\"about\">\\n\u003Ca class=\"\" href=\"\u002Fabout\u002F\" title=\"\">About\u003C\u002Fa>\\n\u003Cul aria-hidden=\"true\" class=\"subnav menu\" role=\"menu\">\\n\u003Cli class=\"tier-2 element-1\" role=\"treeitem\">\u003Ca href=\"\u002Fabout\u002Fapps\u002F\" title=\"\">Applications\u003C\u002Fa>\u003C\u002Fli>\\n\u003Cli class=\"tier-2 element-2\" role=\"treeitem\">\u003Ca href=\"\u002Fabout\u002Fquotes\u002F\" title=\"\">Quotes\u003C\u002Fa>\u003C\u002Fli>\\n\u003Cli class=\"tier-2 element-3\" role=\"treeitem\">\u003Ca href=\"\u002Fabout\u002Fgettingstarted\u002F\" title=\"\">Getting Started\u003C\u002Fa>\u003C\u002Fli>\\n\u003Cli class=\"tier-2 element-4\" role=\"treeitem\">\u003Ca href=\"\u002Fabout\u002Fhelp\u002F\" title=\"\">Help\u003C\u002Fa>\u003C\u002Fli>\\n\u003Cli class=\"tier-2 element-5\" role=\"treeitem\">\u003Ca href=\"http:\u002F\u002Fbrochure.getpython.info\u002F\" title=\"\">Python Brochure\u003C\u002Fa>\u003C\u002Fli>\\n\u003C\u002Ful>\\n\u003C\u002Fli>'\n\n\n\nSelect Elements within Elements:\n\n.. code-block:: pycon\n\n    >>> about.find('a')\n    [\u003CElement 'a' href='\u002Fabout\u002F' title='' class=''>, \u003CElement 'a' href='\u002Fabout\u002Fapps\u002F' title=''>, \u003CElement 'a' href='\u002Fabout\u002Fquotes\u002F' title=''>, \u003CElement 'a' href='\u002Fabout\u002Fgettingstarted\u002F' title=''>, \u003CElement 'a' href='\u002Fabout\u002Fhelp\u002F' title=''>, \u003CElement 'a' href='http:\u002F\u002Fbrochure.getpython.info\u002F' title=''>]\n\nSearch for links within an element:\n\n.. code-block:: pycon\n\n    >>> about.absolute_links\n    {'http:\u002F\u002Fbrochure.getpython.info\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fgettingstarted\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fquotes\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fhelp\u002F', 'https:\u002F\u002Fwww.python.org\u002Fabout\u002Fapps\u002F'}\n\n\nSearch for text on the page:\n\n.. code-block:: pycon\n\n    >>> r.html.search('Python is a {} language')[0]\n    programming\n\nMore complex CSS Selector example (copied from Chrome dev tools):\n\n.. code-block:: pycon\n\n    >>> r = session.get('https:\u002F\u002Fgithub.com\u002F')\n    >>> sel = 'body > div.application-main > div.jumbotron.jumbotron-codelines > div > div > div.col-md-7.text-center.text-md-left > p'\n    >>> print(r.html.find(sel, first=True).text)\n    GitHub is a development platform inspired by the way you work. From open source to business, you can host and review code, manage projects, and build software alongside millions of other developers.\n\nXPath is also supported:\n\n.. code-block:: pycon\n\n   >>> r.html.xpath('\u002Fhtml\u002Fbody\u002Fdiv[1]\u002Fa')\n   [\u003CElement 'a' class=('px-2', 'py-4', 'show-on-focus', 'js-skip-to-content') href='#start-of-content' tabindex='1'>]\n\n\nJavaScript Support\n==================\n\nLet's grab some text that's rendered by JavaScript. Until 2020, the Python 2.7 countdown clock (https:\u002F\u002Fpythonclock.org) will serve as a good test page:\n\n.. code-block:: pycon\n\n    >>> r = session.get('https:\u002F\u002Fpythonclock.org')\n\nLet's try and see the dynamically rendered code (The countdown clock). To do that quickly at first, we'll search between the last text we see before it ('Python 2.7 will retire in...') and the first text we see after it ('Enable Guido Mode').\n\n.. code-block:: pycon\n\n\t>>> r.html.search('Python 2.7 will retire in...{}Enable Guido Mode')[0]\n\t'\u003C\u002Fh1>\\n        \u003C\u002Fdiv>\\n        \u003Cdiv class=\"python-27-clock\">\u003C\u002Fdiv>\\n        \u003Cdiv class=\"center\">\\n            \u003Cdiv class=\"guido-button-block\">\\n                \u003Cbutton class=\"js-guido-mode guido-button\">'\n\nNotice the clock is missing. The ``render()`` method takes the response and renders the dynamic content just like a web browser would.\n\n.. code-block:: pycon\n\n    >>> r.html.render()\n    >>> r.html.search('Python 2.7 will retire in...{}Enable Guido Mode')[0]\n    '\u003C\u002Fh1>\\n        \u003C\u002Fdiv>\\n        \u003Cdiv class=\"python-27-clock is-countdown\">\u003Cspan class=\"countdown-row countdown-show6\">\u003Cspan class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">1\u003C\u002Fspan>\u003Cspan class=\"countdown-period\">Year\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">2\u003C\u002Fspan>\u003Cspan class=\"countdown-period\">Months\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">28\u003C\u002Fspan>\u003Cspan class=\"countdown-period\">Days\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">16\u003C\u002Fspan>\u003Cspan class=\"countdown-period\">Hours\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">52\u003C\u002Fspan>\u003Cspan class=\"countdown-period\">Minutes\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">46\u003C\u002Fspan>\u003Cspan class=\"countdown-period\">Seconds\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fdiv>\\n        \u003Cdiv class=\"center\">\\n            \u003Cdiv class=\"guido-button-block\">\\n                \u003Cbutton class=\"js-guido-mode guido-button\">'\n\nLet's clean it up a bit. This step is not needed, it just makes it a bit easier to visualize the returned html to see what we need to target to extract our required information. \n\n.. code-block:: pycon\n\n\t>>> from pprint import pprint\n\t>>> pprint(r.html.search('Python 2.7 will retire in...{}Enable')[0])\n\t('\u003C\u002Fh1>\\n'\n '        \u003C\u002Fdiv>\\n'\n '        \u003Cdiv class=\"python-27-clock is-countdown\">\u003Cspan class=\"countdown-row '\n 'countdown-show6\">\u003Cspan class=\"countdown-section\">\u003Cspan '\n 'class=\"countdown-amount\">1\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-period\">Year\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">2\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-period\">Months\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">28\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-period\">Days\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">16\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-period\">Hours\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">52\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-period\">Minutes\u003C\u002Fspan>\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-section\">\u003Cspan class=\"countdown-amount\">46\u003C\u002Fspan>\u003Cspan '\n 'class=\"countdown-period\">Seconds\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fdiv>\\n'\n '        \u003Cdiv class=\"center\">\\n'\n '            \u003Cdiv class=\"guido-button-block\">\\n'\n '                \u003Cbutton class=\"js-guido-mode guido-button\">')\n\nThe rendered html has all the same methods and attributes as above. Let's extract just the data that we want out of the clock into something easy to use elsewhere and introspect like a dictionary.\n\n.. code-block:: pycon\n\t\n\t>>> periods = [element.text for element in r.html.find('.countdown-period')]\n\t>>> amounts = [element.text for element in r.html.find('.countdown-amount')]\n\t>>> countdown_data = dict(zip(periods, amounts))\n\t>>> countdown_data\n\t{'Year': '1', 'Months': '2', 'Days': '5', 'Hours': '23', 'Minutes': '34', 'Seconds': '37'}\n\nOr you can do this async also:\n\n.. code-block:: pycon\n\n    >>> async def get_pyclock():\n    ...     r = await asession.get('https:\u002F\u002Fpythonclock.org\u002F')\n    ...     await r.html.arender()\n    ...     return r\n    ...\n    >>> results = asession.run(get_pyclock, get_pyclock, get_pyclock)\n\nThe rest of the code operates the same way as the synchronous version except that ``results`` is a list containing multiple response objects however the same basic processes can be applied as above to extract the data you want. \n\nNote, the first time you ever run the ``render()`` method, it will download\nChromium into your home directory (e.g. ``~\u002F.pyppeteer\u002F``). This only happens\nonce.\n\nUsing without Requests\n======================\n\nYou can also use this library without Requests:\n\n.. code-block:: pycon\n\n    >>> from requests_html import HTML\n    >>> doc = \"\"\"\u003Ca href='https:\u002F\u002Fhttpbin.org'>\"\"\"\n    >>> html = HTML(html=doc)\n    >>> html.links\n    {'https:\u002F\u002Fhttpbin.org'}\n\n\nInstallation\n============\n\n.. code-block:: shell\n\n    $ pipenv install requests-html\n    ✨🍰✨\n\nOnly **Python 3.6 and above** is supported.\n","requests-html 是一个用于简化 HTML 解析（例如网页抓取）的 Python 库。其核心功能包括支持 JavaScript 渲染、CSS 选择器和 XPath 选择器，以及模拟用户代理等特性，同时提供了异步请求的支持。该库基于 Requests 库，因此具有连接池管理和 Cookie 持久化等优点，并且能够自动处理重定向。适用于需要进行网页内容抓取与分析的各种场景，特别是当目标网站包含动态加载的内容时，requests-html 的 JavaScript 支持可以确保获取到完整页面信息。","2026-06-11 03:33:57","high_star"]