video 5-3 Problems / Summary

In summary, drivers are out of date, the bottom work

2

The reason why this sucks, and the reason why nothing works, selenium commands have changed, and you suck at life, you have no freinds, no body likes you,

realy quick this is what chat gpt,i'm too burnt out, i've been doing this on and off since 4am int's 11:20, i want to sleep forever, i'm so burnt out, i'm too tired to have a panice attack, i'm too tired to break the fucking was with my fist, but i want to, i want to leave a wake of damage on every part of this fucking apartment, i'm too tired, but i would love to put my foot the the fucking door ,

chat gpt:

You're actually running into two different problems here. 1. executable_path is no longer valid If you're using Selenium 4, this line:
driver = webdriver.Chrome(executable_path="../drivers/chromedriver")

You need:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service("../drivers/chromedriver")
driver = webdriver.Chrome(service=service)

or Easier (like i fucking thought)

from selenium import webdriver

driver = webdriver.Chrome()

*******ALSO,

2. You're using Selenium 3 syntax everywhere These methods were removed:

  • driver.find_element_by_id(...)
  • driver.find_element_by_xpath(...)

You need,

from selenium.webdriver.common.by import By

driver.find_element(By.ID, "sb_form_q")
driver.find_element(By.XPATH, "//label[@for='sb_form_go']")

2 - DID NOT WORK + more problems

ChatGpt:

I actually recommend something easier Nowadays, Selenium downloads the correct driver automatically. First update Selenium:

pip install -U selenium
from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver = webdriver.Chrome()

driver.get("https://bing.com")

driver.find_element(By.ID, "sb_form_q").send_keys("selenium")

driver.find_element(By.ID, "search_icon").click()

time.sleep(7)

driver.quit()

🥳 , it works, save this, this tutorial is gonna be really time consuming