So I've been trying to follow this YouTube tutorial (https://www.youtube.com/watch?v=BGU2X5lrz9M) as a quick fun project to introduce myself to selenium, but I've already run into a problem. Whenever I run my code, I keep getting this error: 'chromedriver' executable needs to be in PATH. I've searched up the problem many times, moved chromedriver.exe to the C:/ directory to make things easier, and did all I can with the enviroment variables and still can't figure this out. Please help me out! Here's the code I'm running
# This bot is made following this YouTube tutorial: https://www.youtube.com/watch?v=BGU2X5lrz9M
# All the import crap
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Chrome("C:\\chromedriver.exe")
class InstaBot:
def __init__(self, username, password):
self.username = username
self.password = password
self.driver = webdriver.Chrome()
def close_browser(self):
self.driver.close()
def login(self):
global driver
driver = self.driver
driver.get("https://www.instagram.com/accounts/login/?source=auth_switcher")
time.sleep(2)
# "//a[@href'accounts/login']"
# "//input[@name='username']"
# "//input[@name='password']"
georgeIG = InstaBot("NotGonnaShowToStackOverflow", "NotGonnaShowToStackOverflow")
georgeIG.login()