Python filenotfounderror: [Winerror 2] The system cannot find the file specified.

Source: Internet
Author: User
Tags stdin

Traceback (most recent): File "c:\_____soft______\python3.6\lib\site-packages\selenium\webdriver\common\ service.py ", line-up, in-start stdin=pipe) File" c:\_____soft______\python3.6\lib\subprocess.py ", line 709, in __init_ _ Restore_signals, Start_new_session) File "c:\_____soft______\python3.6\lib\subprocess.py", line 997, in _execute_chi LD startupinfo) Filenotfounderror: [Winerror 2] The system cannot find the file specified. During handling of the above exception, another exception Occurred:traceback (most recent call last): File "alimama.py", Line on <module> sp = Spider () File "alimama.py", line one, in __init__ self.web = Webdriver. Chrome () File "c:\_____soft______\python3.6\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line-up, in _ _init__ Self.service.start () File "c:\_____soft______\python3.6\lib\site-packages\selenium\webdriver\common\ service.py ", line-I, in Start Os.path.basename (Self.path), self.start_error_message) Selenium.common.exceptions.WebDrIverexception:message: ' chromedriver ' executable needs to is in PATH. Please see Https://sites.google.com/a/chromium.org/chromedriver/home

1, first need to download browser driver
2, even if it is Firefox, in version>47, also need to install Firefox browser driver
3. The browser driver needs to be placed in the Python installation directory
4, System environment variables, path needs to add browser driver address

Modify the subprocess.py file

    def __init__ (self, args, bufsize=-1, Executable=none,                 Stdin=none, Stdout=none, Stderr=none,shell=true,  add here                 Preexec_fn=none, Close_fds=_platform_default_close_fds,                 shell=false, Cwd=none, Env=none, Universal_ Newlines=false,                 Startupinfo=none, creationflags=0,                 restore_signals=true, Start_new_session=false,                 Pass_fds= (), *, Encoding=none, Errors=none):

Python filenotfounderror: [Winerror 2] The system cannot find the file specified.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.