scornful-crimsonS
Apify & Crawleeโ€ข3y agoโ€ข
3 replies
scornful-crimson

Function not executing for a reason.

async def main():


    async with Actor:
        input_data = await Actor.get_input() 
        urls = input_data['websites']
        print(urls)




    async with aiohttp.ClientSession() as session:
        tasks = [fetch_emails(session, website) for website in urls]
        results = await asyncio.gather(*tasks)
        print('here')
    dataset = apify_client.dataset()
    for email in website_list:
        print(email)
        dataset.push_data({"email": email})

    print(website_list)
    print(f"tried to scrape {len(urls)}")
    print(f"there is {invalid_url}")
    print(f'successfully scraped {len(website_list)} emails ! ')

asyncio.run(main())
the
async with Actor:
        input_data = await Actor.get_input() 
        urls = input_data['websites']
        print(urls)
does print the url. But after that, the code stops. The scripts work fine in vsc. I'm trying to integrate it with apify but I'm facing some issues.
Was this page helpful?