I want to use selenium in the spyder/Jupyter-notebook, but I can not download the driver. Is it possible to somehow use selenium without download the driver, like in collab version
I want to use selenium in the spyder/Jupyter-notebook, but I can not download the driver. Is it possible to somehow use selenium without download the driver, like in collab version
Selenium is a tool that mainly enables and supports automation of web browsers. Therefore, it does require a web driver at the back-end. From the docs:
To use Selenium in your automation project you need to install the language bindings libraries for your language of choice. In addition you will need WebDriver binaries for the browsers you want to automate and run test on.
Moreover, looking at the repo you can see that it does require a driver depending on which browser you plan to use.
If you cannot install a driver because of policy restrictions, speak to your admin and explain why you need it; they might be able to install it for you.
You can user Remote driver if you don't want to run it locally. For example you can run it on aws device farm.Here is an example on how to do it if you want to do it on aws device farm:
https://docs.aws.amazon.com/devicefarm/latest/testgrid/testing-frameworks-python.html
import boto3
from selenium.webdriver import DesiredCapabilities
from selenium.webdriver import Remote
class MyPytestTests():
def setup_method(self, method):
devicefarm_client = boto3.client("devicefarm")
testgrid_url_response = devicefarm_client.create_test_grid_url(
projectArn= "arn:aws:devicefarm:us-west-2:111122223333:testgrid-project:123e4567-e89b-12d3-a456-426655440000",
expiresInSeconds=300
)
desired_capabilities = DesiredCapabilities.FIREFOX
desired_capabilities["platform"] = "windows"
self.driver = Remote(testgrid_url_response['url'], desired_capabilities)
and for teardown:
def teardown_method(self, method):
self.driver.quit()
(excerpt from aws docs)
You can use headless approach to run selenium. https://dev.to/googlecloud/using-headless-chrome-with-cloud-run-3fdp