Python Forum
"I'm Feeling Lucky" script problem (again)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"I'm Feeling Lucky" script problem (again)
#6
Quote: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/...river/home
You most have chromedriver.exe in your Windows Path.
Also in Environment Variables Path i have C:\cmder\bin.

Test code.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time

#--| Setup
chrome_options = Options()
#chrome_options.add_argument("--headless")
browser = webdriver.Chrome(executable_path=r'C:\cmder\bin\chromedriver.exe')
#--| Parse or automation
browser.get('https://duckduckgo.com')
input_field = browser.find_elements_by_css_selector('#search_form_input_homepage')
input_field[0].send_keys('car' + Keys.RETURN)
time.sleep(3)
images_link = browser.find_elements_by_link_text('Images') # Or name your country use
images_link[0].click()
time.sleep(5)
browser.quit()
Reply


Messages In This Thread
RE: "I'm Feeling Lucky" script problem (again) - by snippsat - Jul-23-2019, 09:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  requests problem in python script "content type" abdlwafitahiri 4 3,214 Dec-29-2019, 02:29 PM
Last Post: abdlwafitahiri
  Project: “I’m Feeling Lucky” Google Search Truman 31 28,513 Jul-09-2019, 04:20 PM
Last Post: tab_lo_lo
  Problem With Simple Multiprocessing Script digitalmatic7 11 9,262 Apr-16-2018, 07:18 PM
Last Post: digitalmatic7

Forum Jump:

User Panel Messages

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