from typing import Any, Dict, Optional from apify_client import ApifyClient from .client import BaseClient class InstagramScraper(BaseClient): """Instagram scraper configured for a compatible Apify actor.""" actor_id = "shu8hvrXbJbY3Eb9W" def __init__( self, client: Optional[ApifyClient] = None, actor_id: Optional[str] = None, *, run_input: Optional[Dict[str, Any]] = None, ) -> None: default_run_input = { "resultsType": "posts", "directUrls": [ "https://www.instagram.com/explore/tags/ai/", "https://www.instagram.com/explore/tags/machinelearning/", "https://www.instagram.com/explore/tags/llm/" ], "resultsLimit": 100, "searchType": "hashtag", "searchLimit": 10, "addParentData": False, } super().__init__( client=client, actor_id=actor_id or self.actor_id, default_run_input=default_run_input, ) if run_input: self.default_run_input.update(run_input)