"platform ": { "title": "Search engine", "type": "string", "description": "Select the search engine you want your websites from.", "editor": "select", "default": "Duckduckgo", "enum": ["ddg", "ggl", "serp"], "enumTitles": ["Duckduckgo", "Google", "Serpapi"] },
actor_input = await Actor.get_input() or {} raw_query = actor_input.get('query') query = raw_query.replace(" ", "+") numbers_of_results = actor_input.get('results') engine = actor_input.get('platform')
request = r.get(url=url, timeout=1.5)
install_reactor('twisted.internet.asyncioreactor.AsyncioSelectorReactor')
settings = get_project_settings() settings['TWISTED_REACTOR'] = 'twisted.internet.asyncioreactor.AsyncioSelectorReactor'
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())
async with Actor: input_data = await Actor.get_input() urls = input_data['websites'] print(urls)