selenium-webdriver打开的浏览器有哪些功能? [英] What are the capabilities of the browser opened by selenium-webdriver?
本文介绍了selenium-webdriver打开的浏览器有哪些功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很想知道通过以下代码打开的Chrome浏览器的功能:
I am curious to know the capabilities of the Chrome browser opened through the code:
driver=webdriver.chromedriver()
与incognito
模式相同还是有不同的类型?
Is it same as that of incognito
mode or is there a different kind?
推荐答案
要提取 ChromeDriver / Chrome浏览器的功能,可以使用capabilities
属性,该属性返回字典,您可以使用以下解决方案:
To extract the capabilities of the ChromeDriver / Chrome Browser you can use the capabilities
property which returns a dictionary and you can use the following solution:
-
代码块:
Code Block:
from selenium import webdriver
driver = webdriver.Chrome(executable_path="C:\\Utility\\BrowserDrivers\\chromedriver.exe")
my_dict = driver.capabilities
for key,val in my_dict.items():
print (key, "=>", val)
driver.quit()
控制台输出:
Console Output:
acceptInsecureCerts => False
browserName => chrome
browserVersion => 76.0.3809.100
chrome => {'chromedriverVersion': '76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864})', 'userDataDir': 'C:\\Users\\Debanjan.B\\AppData\\Local\\Temp\\scoped_dir3888_683123771'}
goog:chromeOptions => {'debuggerAddress': 'localhost:26050'}
networkConnectionEnabled => False
pageLoadStrategy => normal
platformName => windows nt
proxy => {}
setWindowRect => True
strictFileInteractability => False
timeouts => {'implicit': 0, 'pageLoad': 300000, 'script': 30000}
unhandledPromptBehavior => dismiss and notify
这篇关于selenium-webdriver打开的浏览器有哪些功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文