ruia_cache - A Ruia plugin for caching URL.
Project description
ruia-cache
A Ruia plugin for caching URL
Installation
pip install -U ruia-cache
# New features
pip install git+https://github.com/python-ruia/ruia-cache
Usage
ruia-cache
will automatically cache the captured URL to prevent the second request to the target web page:
import os
from ruia_cache import RuiaCacheSpider
# Set RUIA_CACHE path
os.environ.setdefault(
"RUIA_CACHE", os.path.dirname(__file__),
)
class Demo(RuiaCacheSpider):
name = "demo_spider"
start_urls = ["http://httpbin.org/get"]
async def parse(self, response):
html = await response.text()
print(html)
if __name__ == "__main__":
Demo.start()
# Using cache data
Demo.start()
Enjoy it :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ruia_cache-0.0.1.tar.gz
(5.2 kB
view hashes)
Built Distribution
ruia_cache-0.0.1-py3-none-any.whl
(12.0 kB
view hashes)
Close
Hashes for ruia_cache-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fde292839441a40942ed19f6b8c191e3187a7fcc8ce9b1906c7a04bc37471efd |
|
MD5 | 9b52e1f06165817d7e1bc8bf931a58b3 |
|
BLAKE2b-256 | c94fbd324ec7e1f0d0e3887ae85fe4aee8048bf6d76d2d27098d022607514eb0 |