The package for interacting with API of anti-detect browser AdsPower.
Project description
adspower
The package for interacting with API of anti-detect browser AdsPower.
adspower's source code is made available under the MIT License
Restrictions
- During using the package, AdsPower must be opened.
- The local API is available only in paid AdsPower subscriptions
- AdsPower has frequency control for all APIs, max. access frequency: 1 request/second
Quick start
For example, you can use driver by the following way.
from adspower import AdsPower
ads_power = AdsPower('ja54rwh')
with ads_power as driver:
driver.get('https://github.com/blnkoff/adspower')
Here is example of usage of creating profiles from proxies
from adspower import AdsPower, CreateProfileParams, UserProxyConfig
def create_profiles(config: dict[str], proxies) -> list[AdsPower]:
group_name = config['ads_power']['group_name']
group_id = AdsPower.query_group(group_name=group_name)[0]['group_id']
data_set = []
for proxy in proxies:
proxy_config = UserProxyConfig(
proxy_soft='other',
proxy_type=proxy.type,
proxy_host=proxy.host,
proxy_port=proxy.port,
proxy_user=proxy.login,
proxy_password=proxy.password
)
data_set.append(CreateProfileParams(group_id=group_id, user_proxy_config=proxy_config))
profiles = []
for data in data_set:
profiles.append(AdsPower.create_profile(data))
return profiles
Here is example of retrieving profiles from AdsPower
from adspower import AdsPower
def retrieve_profiles(config: dict[str]):
group_name = config['ads_power']['group_name']
group_id = AdsPower.query_group(group_name=group_name)['group_id']
response = AdsPower.query_profiles(group_id=group_id)
profiles = [AdsPower(profile['user_id']) for profile in response]
return profiles
Installing adspower
To install the package from GitHub you can use that:
pip install git+https://github.com/blnkoff/adspower.git
To install the package from PyPi you can use that:
pip install adspower
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
adspower-1.0.0.tar.gz
(8.4 kB
view hashes)