Python Forum
Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure (/thread-13932.html)



Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure - dadadance - Nov-07-2018

Hi,
I am running Python Jupyter notebooks on https://notebooks.azure.com in browser (can't install anything on my office laptop, and this has been a salvation), but for Selenium framework, I am unable to make WebDriver work - the error message:

WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Also, uploading the chromedriver.exe file to library and directly pointing to it did not help either.

driver = webdriver.Chrome('/home/nbuser/library/chromedriver.exe')

Any suggestions for a solution?

Thanks!


RE: Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure - snippsat - Nov-07-2018

chromedriver.exe need to be in Environment Variables Path or in same folder as you run script from.
A basic setup,so i have cmder bin folder set in Path:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time

#--| Setup
chrome_options = Options()
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()
More setup here


RE: Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure - dadadance - Nov-08-2018

@snipstat, thank you for your detailed answer, but as I mentioned, I am unable to install anything on my office laptop, therefore using Jupyter Notebooks on Azure. But adding the chromedriver.exe to my user library folder and pointing the path to it driver = webdriver.Chrome('/home/nbuser/library/chromedriver.exe'), it still did not work.
So, the question is: is it possible to run Selenium for Python on Jupyter Notebooks on Microsoft Azure and where do I store the chromedriver.exe?

Thanks once again!


RE: Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure - asimrajan - Jul-31-2019

(Nov-08-2018, 06:43 PM)dadadance Wrote: @snipstat, thank you for your detailed answer, but as I mentioned, I am unable to install anything on my office laptop, therefore using Jupyter Notebooks on Azure. But adding the chromedriver.exe to my user library folder and pointing the path to it driver = webdriver.Chrome('/home/nbuser/library/chromedriver.exe'), it still did not work.
So, the question is: is it possible to run Selenium for Python on Jupyter Notebooks on Microsoft Azure and where do I store the chromedriver.exe?

Thanks once again!

Hey, did you find the solution to this?


RE: Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure - perfringo - Jul-31-2019

Did you encountered problem(s) while installing package or setting project environment?