CA
Crawlee & Apify16mo ago
conscious-sapphire

Run instance of apify client not returning, cant access data scraped from my Apify agent

Hey guys, I'm getting an issue where I the run instance of the client.actor call for the python SDK is not returning ? it just says the call is 'running' so I can't access the items for the agent : def apify_reddit_agent(json_input) :
def apify_reddit_agent(json_input) :
info_array = []
#Changed the API key here to the samuel account instead.
client = ApifyClient(APIFY_API_KEY)

run_input=json_input

print("calling API endpoint")
run = client.actor("trudax/reddit-scraper-lite").call(run_input=run_input)
print("looping through items...")
for item in client.dataset(run["defaultDatasetId"]).iterate_items() :
info_array.append(item)
return info_array
def apify_reddit_agent(json_input) :
info_array = []
#Changed the API key here to the samuel account instead.
client = ApifyClient(APIFY_API_KEY)

run_input=json_input

print("calling API endpoint")
run = client.actor("trudax/reddit-scraper-lite").call(run_input=run_input)
print("looping through items...")
for item in client.dataset(run["defaultDatasetId"]).iterate_items() :
info_array.append(item)
return info_array
` Is there anyway I can fix it? I'm thinking of just creating my own library for calling the HTTP endpoints for reliability concerns, as sometimes the SDK works and sometimes it doesn't
1 Reply
absent-sapphire
absent-sapphire16mo ago
cc @Vlada Dusek Python stuff. Can You take a look please? @waltuh if you have question related to Python, please post it to #crawlee-python 🙏 Further conversation will be here: https://discord.com/channels/801163717915574323/1209538016356597841/1209538016356597841

Did you find this page helpful?