Unofficial Octoparse API client.
Project description
Octoparse
Unofficial Octoparse API client in python
Now with support for Advanced API and China as well
Installation:
use pip to install:
pip install octoparse
Example usage:
from octoparse import Octoparse
# initialize api client
# it will try to log in & ask for credentials if required
octo = Octoparse()
# if using advanced API:
octo = Octoparse(advanced_api=True)
# if using from China:
octo = Octoparse(china=True)
# List all task groups
groups = octo.list_all_task_groups()
# List all tasks in a group
tasks = octo.list_all_tasks_in_group(group_id='xxxx-ssdsd-1212')
# Check if a Task is currently running. This isn't provided in Standard API.
status = octo.is_task_running(task_id='abcd-1234-djfsd-dfdf')
# Export the not exported data
data = octo.get_not_exported_data(task_id='abcd-1234-djfsd-dfdf', size=100)
# Update data status
resp = octo.update_data_status(task_id='abcd-1234-djfsd-dfdf')
# get data for a task with task id: 'abcd-1234-djfsd-dfdf'
data = octo.get_task_data(task_id='abcd-1234-djfsd-dfdf')
# get task data as a pandas.DataFrame for a task with task id: 'abcd-1234-djfsd-dfdf'
df = octo.get_task_data_df(task_id='abcd-1234-djfsd-dfdf')
# clear data for a task with task id: 'abcd-1234-djfsd-dfdf'
octo.clear_task_data(task_id='abcd-1234-djfsd-dfdf')
Following are supported for Advanced API
# Get Tasks' status
task_list = ['abcd-1234-djfsd-dfdf', 'ab23-5677-djfsd-dfdf']
resp = octo.get_task_status(task_list)
# Get Task's parameter
resp = octo.get_task_param(task_id='abcd-1234-djfsd-dfdf', name='loopAction1.Url')
# Update Task's parameter
resp = octo.update_task_param(task_id='abcd-1234-djfsd-dfdf', name='loopAction1.Url', value='http://xyz.abc')
# Add new URLs/text to an existing loop
resp = octo.add_url_text_to_loop(task_id='abcd-1234-djfsd-dfdf', name='loopAction1.Url', value='http://xyz.abc')
# Start running task
resp = octo.start_task(task_id='abcd-1234-djfsd-dfdf')
# Stop running task
resp = octo.stop_task(task_id='abcd-1234-djfsd-dfdf')
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
octoparse-1.3.1.tar.gz
(6.3 kB
view hashes)
Built Distribution
octoparse-1.3.1-py3-none-any.whl
(10.3 kB
view hashes)
Close
Hashes for octoparse-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31a95a66771140b8bc04c355feb0569aa95d6033bd8e00012f02719b5e4d5fb4 |
|
MD5 | 242f77cbeae93a8fd6af662828d69573 |
|
BLAKE2b-256 | 25303e3b8f9b68817d9de877a3296e091dba6c2f19f9caf09ba955e9c4967da9 |