# Getting WebDriver.jl to work - what could cause init\_chrome to throw an error?

**URL:** https://discourse.julialang.org/t/getting-webdriver-jl-to-work-what-could-cause-init-chrome-to-throw-an-error/61456
**Category:** New to Julia
**Created:** [May 19, 2021, 4:05pm UTC](https://discourse.julialang.org/t/getting-webdriver-jl-to-work-what-could-cause-init-chrome-to-throw-an-error/61456 "2021-05-19T16:05:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Nash](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nash/32/14482_2.png) [@Nash](https://discourse.julialang.org/u/Nash)
#### Post date: [May 19, 2021, 4:05pm UTC](https://discourse.julialang.org/t/getting-webdriver-jl-to-work-what-could-cause-init-chrome-to-throw-an-error/61456/1 "2021-05-19T16:05:25Z")

</div>

I am following a clip on using Selenium:

[Selenium](https://youtu.be/UORHL0gJH9A?list=PLJ39kWiJXSiyDb2i4H1LFqby2wNQgJ_IH)

I have:

- Installed the latest version of Python
- pip install selenium
- added WebDriver.jl (I use Atom).
- added PyCall.jl (again, via Atom)
- installed chromedriver

Now, the following creates an error:

```
using PyCall
using WebDriver

browser = init_chrome()

```

I get the error:

“ **UndefVarError: init\_chrome not defined** ”

What am I doing wrong? What have I missed?

UPDATE:  
I tried re-installing Python using Conda (I manually installed the latest version of Python prior to that). I also used Conda to add selenium. But, I still get the same problem.

---

<div class="post-metadata">

### Author: ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)
#### Post date: [May 20, 2021, 1:10pm UTC](https://discourse.julialang.org/t/getting-webdriver-jl-to-work-what-could-cause-init-chrome-to-throw-an-error/61456/2 "2021-05-20T13:10:14Z")

</div>

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/](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

```julia
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() 

```
