ruia-ua
simple user-agent middleware for Ruia
Installation
pip install -U ruia-ua
Usage
ruia-ua will be automatically with a random User-Agent for your request's headers
from ruia import AttrField, TextField, Item, Spider
from ruia_ua import middleware
class HackerNewsItem(Item):
target_item = TextField(css_select='tr.athing')
title = TextField(css_select='a.storylink')
url = AttrField(css_select='a.storylink', attr='href')
class HackerNewsSpider(Spider):
start_urls = ['https://news.ycombinator.com/news?p=1', 'https://news.ycombinator.com/news?p=2']
async def parse(self, response):
# Do something...
print(response.html)
if __name__ == '__main__':
HackerNewsSpider.start(middleware=middleware)
Enjoy it :)
Metadata
Release files for ruia-ua 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ruia_ua-0.0.2.tar.gz | 11.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ruia_ua-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.8 kB
Release files / ruia_ua-0.0.2.tar.gz
| Download URL | ruia_ua-0.0.2.tar.gz |
|---|---|
| Size | 11.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bec4dc3b06cdbbda4254ee9d620230c65fe23abb51ba0829271a3b7594aa7e7
|
|
BLAKE2b-256 checksum How to use checksums |
126089c360dabd57c109bfb4271e00c826fcaac25366310476e362c295990137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.5
|
Release files / ruia_ua-0.0.2-py3-none-any.whl
| Download URL | ruia_ua-0.0.2-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85b0fbbe79836d157db982e9b264cb44de3dfab550ebf15f946d871cd1596b87
|
|
BLAKE2b-256 checksum How to use checksums |
2adccc923a637d6fef4fa34efd1e02f17e7077d14672a230fbfb061855253c6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.5
|
Security for ruia-ua 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.