错误:Geckodriver可执行文件必须位于路径中

时间:2020-06-07 17:22:50

标签: python selenium web screen-scraping geckodriver

from selenium.webdriver.common import service


class Service(service.Service):
    """Object that manages the starting and stopping of the
    GeckoDriver."""

    def __init__(self, executable_path, port=0, service_args=None,
                 log_path="geckodriver.log", env=None):
        """Creates a new instance of the GeckoDriver remote service proxy.

        GeckoDriver provides a HTTP interface speaking the W3C WebDriver
        protocol to Marionette.

        :param executable_path: Path to the GeckoDriver binary.
        :param port: Run the remote service on a specified port.
            Defaults to 0, which binds to a random open port of the
            system's choosing.
        :param service_args: Optional list of arguments to pass to the
            GeckoDriver binary.
        :param log_path: Optional path for the GeckoDriver to log to.
            Defaults to _geckodriver.log_ in the current working directory.
        :param env: Optional dictionary of output variables to expose
            in the services' environment.

Q1:这是我需要为geckodriver设置可执行路径的文件吗? 问题2:我已经安装了geckodriver,并将其提取到Documents文件夹中,所以我应该给出路径= / root / Documents 正确与否?

0 个答案:

没有答案