1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4# Replace '<YOUR_API_TOKEN>' with your token.
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7# Prepare the Actor input
8run_input ={
9"searchQueries":["python programming"],
10"directUrls":["https://www.quora.com/What-is-Python-primarily-used-for"],
11"maxResults":10,
12"proxyConfiguration":{"useApifyProxy":True},
13}
14
15# Run the Actor and wait for it to finish
16run = client.actor("scraper-engine/quora-scraper").call(run_input=run_input)
17
18# Fetch and print Actor results from the run's dataset (if there are any)
19print("πΎ Check your data here: https://console.apify.com/storage/datasets/"+ run["defaultDatasetId"])
20for item in client.dataset(run["defaultDatasetId"]).iterate_items():
21print(item)
22
23# π Want to learn more π? Go to β https://docs.apify.com/api/client/python/docs/quick-start