Skip to main content

httpx with css.

Project description

httpc

httpx with CSS

Examples

>>> import httpc
>>> response = httpc.get("https://www.python.org/")
>>> response.css("strong")  # CSS Query
[<Node strong>, <Node strong>, <Node strong>]
>>> response.css("strong").bc.text()
['Notice:', 'A A', 'relaunched community-run job board']
>>> response.single("div")
ValueError: Query 'div' matched with 47 nodes.
>>> response.single("#content")
<Node div>
>>> httpc.get("https://python.org")                 
<Response [301 Moved Permanently]>
>>> httpc.common.get("https://python.org") 
<Response [200 OK]>
>>> httpc.get("https://httpbin.org/status/400")
<Response [400 BAD REQUEST]>
>>> httpc.get("https://httpbin.org/status/400", raise_for_status=True)
httpx.HTTPStatusError: Client error '400 BAD REQUEST' for url 'https://httpbin.org/status/400'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpc-0.2.0.tar.gz (52.1 kB view hashes)

Uploaded Source

Built Distribution

httpc-0.2.0-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page