![](/img/trans.png)
[英]Is it possible to use the HTMLUnit driver in Python with Selenium?
[英]Is it possible to use Senenium without driver?
我想在spyder/Jupyter-notebook中使用selenium,但是無法下載驅動。 是否可以在不下載驅動程序的情況下以某種方式使用 selenium,例如在協作版本中
如果您不想在本地運行它,您可以使用Remote
驅動程序。 例如,您可以在 aws 設備場上運行它。如果您想在 aws 設備場上執行此操作,以下是一個示例:
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)
和拆解:
def teardown_method(self, method):
self.driver.quit()
(摘自 aws 文檔)
您可以使用無頭方法運行 selenium。 https://dev.to/googlecloud/using-headless-chrome-with-cloud-run-3fdp
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.