Example #1
0
 def __init__(self, crawler: Crawler) -> None:
     super().__init__(settings=crawler.settings, crawler=crawler)
     verify_installed_reactor(
         "twisted.internet.asyncioreactor.AsyncioSelectorReactor")
     crawler.signals.connect(self._launch_browser_signal_handler,
                             signals.engine_started)
     self.stats = crawler.stats
     self.navigation_timeout: Optional[int] = None
     if crawler.settings.get("PYPPETEER_NAVIGATION_TIMEOUT"):
         self.navigation_timeout = crawler.settings.getint(
             "PYPPETEER_NAVIGATION_TIMEOUT")
     self.browser: Optional[pyppeteer.browser.Browser] = None
     self.launch_options: dict = crawler.settings.getdict(
         "PYPPETEER_LAUNCH_OPTIONS") or {}
     if ("executablePath" not in self.launch_options
             and Path(pyppeteer.executablePath()).is_file()):
         self.launch_options["executablePath"] = pyppeteer.executablePath()
     logger.info("Browser launch options: %s" % self.launch_options)
Example #2
0
 async def test_executable_path(self):
     self.assertTrue(os.path.exists(executablePath()))
Example #3
0
 async def test_executable_path(self):
     self.assertTrue(os.path.exists(executablePath()))
Example #4
0
 def check_path():
     print(pyppeteer.executablePath())