firefox_binary.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:amazon_order_history_scraper 作者: drewctate 项目源码 文件源码
def _get_firefox_start_cmd(self):
        """Return the command to start firefox."""
        start_cmd = ""
        if platform.system() == "Darwin":
            start_cmd = "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
            # fallback to homebrew installation for mac users
            if not os.path.exists(start_cmd):
                start_cmd = os.path.expanduser("~") + start_cmd
        elif platform.system() == "Windows":
            start_cmd = (self._find_exe_in_registry() or self._default_windows_location())
        elif platform.system() == 'Java' and os._name == 'nt':
            start_cmd = self._default_windows_location()
        else:
            for ffname in ["firefox", "iceweasel"]:
                start_cmd = self.which(ffname)
                if start_cmd is not None:
                    break
            else:
                # couldn't find firefox on the system path
                raise RuntimeError(
                    "Could not find firefox in your system PATH." +
                    " Please specify the firefox binary location or install firefox")
        return start_cmd
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号