Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium won't open a link
#1
My code is:

from selenium import webdriver


class Bot:
def __init__(self):
self.driver = webdriver.Chrome()
self.driver.get("https://instagram.com")


Bot()

I get errors in lines that don't exist. The errors are incredibly long and I assume it is errors with webdriver code but I'm not sure. Here are the errors:

Traceback (most recent call last):
File "C:\Users\Justin\PycharmProjects\Instagram bot\venv\lib\site-packages\selenium\webdriver\common\service.py", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\Justin\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Justin\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
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 "C:/Users/Justin/PycharmProjects/Instagram bot/Bot.py", line 10, in <module>
Bot()
File "C:/Users/Justin/PycharmProjects/Instagram bot/Bot.py", line 6, in __init__
self.driver = webdriver.Chrome()
File "C:\Users\Justin\PycharmProjects\Instagram bot\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
self.service.start()
File "C:\Users\Justin\PycharmProjects\Instagram bot\venv\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/...river/home

Anyone know how to fix this?
Reply


Messages In This Thread
Selenium won't open a link - by Justin2444 - Apr-07-2020, 03:51 AM
RE: Selenium won't open a link - by snippsat - Apr-07-2020, 06:44 AM
RE: Selenium won't open a link - by Larz60+ - Apr-07-2020, 09:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  get link and link text from table metulburr 5 6,377 Jun-13-2019, 07:50 PM
Last Post: snippsat
  Firefox Selenium (open new tab) oneclick 1 7,823 Dec-29-2018, 06:59 AM
Last Post: hbknjr
  open a web page by selenium !! evilcode1 3 3,395 Aug-01-2018, 03:05 PM
Last Post: snippsat
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,681 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

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