ail-project / pylacus Goto Github PK
View Code? Open in Web Editor NEWPython module to enqueue and query a remote Lacus instance
Home Page: https://pylacus.readthedocs.io/en/latest/index.html
License: BSD 3-Clause "New" or "Revised" License
Python module to enqueue and query a remote Lacus instance
Home Page: https://pylacus.readthedocs.io/en/latest/index.html
License: BSD 3-Clause "New" or "Revised" License
Use this module to interact with a Lacus instance.
pip install pylacus
You can use the pylacus
command:
$ pylacus -h
usage: pylacus [-h] --url-instance URL_INSTANCE [--redis_up] {enqueue,status,result} ...
Query a Lacus instance.
positional arguments:
{enqueue,status,result}
Available commands
enqueue Enqueue a url for capture
status Get status of a capture
result Get result of a capture.
options:
-h, --help show this help message and exit
--url-instance URL_INSTANCE
URL of the instance.
--redis_up Check if redis is up.
See API Reference
status = lacus.get_capture_status(uuid)
result = lacus.get_capture(uuid)
This code utilizes the redis
library and the lacuscore
and pylacus
modules to capture a web page using LacusCore.
Note: Make sure you have properly installed the required dependencies before executing this code.
from redis import Redis
from lacuscore import LacusCore
from pylacus import PyLacus
redis = Redis()
lacus = PyLacus("http://xxx.xx.xxx.xx:7100/")
# Check if the Redis server is up
if lacus.redis_up():
# Enqueue a capture for the URL(s) you want to capture
uuid = lacus.enqueue(url='google.com') # Replace 'google.com' with the desired URL(s)
# Get the capture result based on the returned UUID
result = lacus.get_capture(uuid)
print(result)
Notes:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.