{"record":{"id":"149737f9e29162e7","repo":"assafelovic/gpt-researcher","slug":"the-zendriver-package-is-required-to-use-nodrivers","errorCode":null,"errorMessage":"The zendriver package is required to use NoDriverScraper. Please install it with: pip install zendriver","messagePattern":"The zendriver package is required to use NoDriverScraper\\. Please install it with: pip install zendriver","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"gpt_researcher/scraper/browser/nodriver_scraper.py","lineNumber":143,"sourceCode":"                # Log error but don't block the request\n                NoDriverScraper.logger.warning(\n                    f\"Rate limiting error for {url}: {str(e)}\"\n                )\n\n        async def stop(self):\n            if self.stopping:\n                return\n            self.stopping = True\n            await self.driver.stop()\n\n    @classmethod\n    async def get_browser(cls, headless: bool = False) -> \"NoDriverScraper.Browser\":\n        async def create_browser():\n            try:\n                global zendriver\n                import zendriver\n            except ImportError:\n                raise ImportError(\n                    \"The zendriver package is required to use NoDriverScraper. \"\n                    \"Please install it with: pip install zendriver\"\n                )\n\n            config = zendriver.Config(\n                headless=headless,\n                browser_connection_timeout=10,\n            )\n            driver = await zendriver.start(config)\n            browser = cls.Browser(driver)\n            cls.browsers.add(browser)\n            return browser\n\n        async with cls.browsers_lock:\n            if len(cls.browsers) == 0:\n                # No browsers available, create new one\n                return await create_browser()\n","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/assafelovic/gpt-researcher/blob/6f998577d547b1e54ec662dac63583aa11e3b84b/gpt_researcher/scraper/browser/nodriver_scraper.py#L125-L161","documentation":"NoDriverScraper optionally depends on the zendriver package for CDP-based browser automation. Inside the async create_browser() factory, it does 'import zendriver' inside a try block; on ImportError it raises a targeted ImportError telling you to pip install zendriver. This fires the first time a browser instance is requested.","triggerScenarios":"Awaiting NoDriverScraper.get_browser(...) (directly or by scraping a URL with NoDriverScraper) when zendriver is not importable — not installed, installed in the wrong environment, or a broken install where importing a submodule fails.","commonSituations":"Choosing the nodriver/zendriver scraper backend without installing its extra; using a venv where only selenium was installed; CI images lacking the package; zendriver renamed or version-locked incorrectly in requirements.txt.","solutions":["Install it: pip install zendriver.","If the project exposes an extra, install that instead (e.g., pip install -U gpt-researcher[zendriver]).","Verify the import resolves in the same interpreter: python -c \"import zendriver; print(zendriver.__version__)\".","If you can't install zendriver, switch the scraper to the selenium-based BrowserScraper and install selenium."],"exampleFix":"# before\nbrowser = await NoDriverScraper.get_browser(headless=True)  # ImportError: ... pip install zendriver\n\n# after\n# pip install zendriver\nbrowser = await NoDriverScraper.get_browser(headless=True)","handlingStrategy":"validation","validationCode":"import importlib.util\n\nif importlib.util.find_spec('zendriver') is None:\n    raise SystemExit('zendriver is required for NoDriverScraper: pip install zendriver')","typeGuard":"def zendriver_available() -> bool:\n    try:\n        import zendriver  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    browser = await NoDriverScraper.get_browser(headless=True)\nexcept ImportError as e:\n    if 'zendriver' in str(e):\n        scraper = BrowserScraper(url)  # selenium fallback\n    else:\n        raise","preventionTips":["Install zendriver in every environment that selects the nodriver scraper.","Feature-detect zendriver at startup and fall back to the selenium scraper.","Pin zendriver in requirements; it evolves quickly with Chrome versions.","Verify with python -c \"import zendriver\" inside the deploy container before shipping."],"tags":["zendriver","import-error","browser-scraper","scraping","dependency"],"backgroundTag":"missing-optional-dependency","analyzedSha":"6f998577d547b1e54ec662dac63583aa11e3b84b","analyzedAt":"2026-08-28T17:50:07.383Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}