Python Selenium: Is there a way to install webdriver inside the virtual enviroment

Viewed 719

I'm planning to build my first web automation project using selenium.

But before that, I'd like to know is there a way to install the web driver inside the virtual environment. I looked in the documentation that you should place the web driver inside the python bin folder, but I would like it to be inside a virtual environment. If there is a way to do that, please show the steps to do it.

1 Answers

If you bundle a WebDriver into the virtual environment, you should also include the browser itself... since it is bound with the browser.

Therefore, it is not recommended to bundle WebDriver with your app that way, and instead you should just run WebDriver separately from your client.

If you really look for bundling WebDriver with your app, you should rather user Docker, since it will allow you to properly install a browser, for example, there is a ready image on Docker hub for that, including Python, Chrome, Chromedriver and some of them also Xvfb.

Related