阅读背景:

selenium+Python 第一篇:为Browser对象封装关键字

来源:互联网 

open_browser

    def open_browser(
        self,
        url: Optional[str] = None,
        browser: str = "firefox",
        alias: Optional[str] = None,
        remote_url: Union[bool, str] = False,
        desired_capabilities: Union[dict, None, str] = None,
        ff_profile_dir: Union[FirefoxProfile, str, None] = None,
        options: Any = None,
        service_log_path: Optional[str] = None,
        executable_path: Optional[str] = None,
    ) -> str:
        index = self.drivers.get_index(alias)
        if index:
            self.info(f"Using existing browser from index {index}.")
            self.switch_browser(alias)
            if url:
                self.go_to(url)
            return index
        return self._make_new_browser(
            url,
            browser,
            alias,
            remote_url,
            desired_capabilities,
            ff_profile_dir,
            options,
            service_log_path,
            executable_path,
        )    def open_browser(
      



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: