Getting WebDriver.jl to work - what could cause init_chrome to throw an error?

This video seems outdated (it refers to an older version of WebDriver.jl).
I don’t think init_chrome is a method/function of WebDriver.jl.
Consider the manual here
https://nosferican.github.io/WebDriver.jl/dev/manual/

It seems you need to run selenium on docker (or similar) for this to work.

If you want a solution via PyCall (without WebDriver.jl), you may consider the following snippet:
I note that WebDriver.jl likely has limited functionality compared to, e.g., the python library for selenium

using Pkg
tmpd = mktempdir()
Pkg.activate(tmpd)
Pkg.add("PyCall")
#Pkg.add("WebDriver")

#using WebDriver
using PyCall

using Conda 
Conda.add("selenium")

webdriver = pyimport("selenium.webdriver")
#webdriver.Edge(),webdriver.Chrome(),webdriver.Firefox() ,webdriver.Ie(),webdriver.Opera(),webdriver.PhantomJS(),webdriver.Safari(),webdriver.Android() 

#you will need to download chromdriver for the next call to work
#also chromedriver.exe needs to be in PATH (windows environment variable) for this to work 
#also the chrome version you have needs to match the chromedriver version
driver = webdriver.Chrome() 
4 Likes