Python Forum
WebDriverException: 'chromedriver' executable needs to be in PATH
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WebDriverException: 'chromedriver' executable needs to be in PATH
#7
Here a example of a working setup.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
import time

#--| Setup
options = Options()
#options.add_argument("--headless")
#options.add_argument("--window-size=1980,1020")
#options.add_argument('--disable-gpu')
browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe', options=options)
#--| Parse or automation
browser.get("https://www.flipkart.com/laptops/~buyback-guarantee-on-laptops-/pr?sid=6bo%2Cb5g&uniq")
time.sleep(2)
soup = BeautifulSoup(browser.page_source, 'lxml')
# Example of using both to parse
use_bs4 = soup.find('div', class_="col col-7-12")
print(use_bs4.text)
print('*' * 25)
use_sel = browser.find_elements_by_css_selector('div > div._1vC4OE._2rQ-NK')
print(use_sel[0].text)
Output:
Apple MacBook Air Core i5 5th Gen - (8 GB/128 GB SSD/Mac OS Sierra) MQD32HN/A A14664.724,087 Ratings & 2,715 ReviewsIntel Core i5 Processor (5th Gen)8 GB DDR3 RAM64 bit Mac OS Operating System128 GB SSD33.78 cm (13.3 inch) Display1 Year Carry In Warranty ************************* ₹65,990
So this Path is for Windows,do you use Mac?
It's the same way,but use chromedriver_mac64.zip then there is no .exe only chromedriver.

If uncomment like this browser will not start up.
#--| Setup
options = Options()
options.add_argument("--headless")
options.add_argument("--window-size=1980,1020")
options.add_argument('--disable-gpu')
Reply


Messages In This Thread
RE: WebDriverException: 'chromedriver' executable needs to be in PATH - by snippsat - Jun-09-2020, 03:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium undetected Chromedriver Bot Laurin0000 1 4,220 Apr-13-2023, 09:20 PM
Last Post: Clixmaster
  enable flash using selenium chromedriver Fre3k 1 4,320 Nov-27-2020, 12:15 PM
Last Post: JellyCreeper6
  Selenium Chromedriver Automation Help lessthanthree 1 2,191 May-05-2020, 11:03 PM
Last Post: Larz60+
  How to identify chromedriver version? metulburr 2 7,818 Jun-13-2019, 11:37 PM
Last Post: metulburr
  Chromedriver launch new tab gahhon 15 10,265 Feb-17-2019, 06:22 PM
Last Post: metulburr
  chromedriver.exe issue gahhon 2 2,876 Feb-12-2019, 12:09 PM
Last Post: metulburr
  Selenium chromedriver and click action Gilles95 4 13,388 Feb-07-2018, 07:28 PM
Last Post: Gilles95
  Getting error 'geckodriver' executable needs to be in PATH. sumandas89 2 37,674 Jan-11-2018, 07:54 AM
Last Post: sumandas89

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020