-2

When I read the chromedriver file path, it occurs this error

Yijie Beh
  • 1
  • 1
  • 2
    Welcome to Stack Overflow! Check out the [tour], and [ask] if you want tips. [Please don't post pictures of text](https://meta.stackoverflow.com/q/285551/4518341). Instead, copy the text, [edit] it into your post, and use the formatting tools like [code formatting](/editing-help#code). – wjandrea Jun 06 '21 at 15:57

1 Answers1

1

The r of a raw-string must come before the quotes, not in the quotes.

chromedriver = r"C:\Users\...."

Btw: Your URL http:google.com (the scheme) is no valid too.

driver.get("http://google.com")

would be correct.
or better:

driver.get("https://www.google.com")
Sven Eberth
  • 3,057
  • 12
  • 24
  • 29
  • After deleting the "r", the error still the same – Yijie Beh Jun 07 '21 at 11:59
  • You should not delete the `r`, you should move it. – Sven Eberth Jun 07 '21 at 12:00
  • (WebDriverException: Message: 'chromedriver_win32.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home) THIS IS THE ERROR AFTER I ADDING 'r' BEFORE THE QUOTE, NEED HELP! – Yijie Beh Jun 07 '21 at 12:30
  • In the screenshot of your question the path doesn't end with `.exe.`. afaik this must point to the file (with the extension), so add it. Check also [this thread](https://stackoverflow.com/questions/29858752/error-message-chromedriver-executable-needs-to-be-available-in-the-path) out. – Sven Eberth Jun 07 '21 at 13:00
  • I have updated my screenshot, but it is same error again. – Yijie Beh Jun 07 '21 at 13:22
  • 1
    Please note that questions caused by a typo are off-topic on [so] as per the [help/on-topic]. If you find such questions, flag or vote them as off-topic, depending on your reputation. Leaving a comment on the question is sufficient if you still want to help the OP in such cases. – MisterMiyagi Jun 07 '21 at 13:26