Integrating Firefox and Selenium Webdriver

I am posting this on my blog to remind me what to do if I have to integrate firefox, and selenium webdriver.

firstly, install selenium using pip.

and then, download the geckodriver that should be compatible / working with selenium webdriver.

In your code, if your python/django app is in virtualbox (headless mode),

it should be something like this:

-------------------------------------------------------------------------
#!/srv/onlinesystem/env/bin/python

from selenium import webdriver
from selenium.webdriver import FirefoxOptions

opts = FirefoxOptions()
opts.add_argument("--headless")
browser = webdriver.Firefox(firefox_options=opts)
browser.get('http://google.com')



Comments

Popular posts from this blog

Setting up a Wordpress Site NGINX and MySQL

Making Movie Reviews