我想知道 IE 是否正确启动或遇到诸如“启动 Internet Explorer 时出现意外错误。IELaunchURL<> return HRESULT 8007007A”之类的问题。所以我打算从驱动程序 grep "selenium" 但显示以下错误 "type 'WebDriver' is not iterable"。我怎么能解决呢?谢谢!
>>> from selenium import webdriver
>>> driver = webdriver.Ie()
>>> other_string = "Use selenium to control IE"
>>> "selenium" in other_string
True
>>> print (driver)
<selenium.webdriver.ie.webdriver.WebDriver (session="daa6e29c-5112-4bc7-8df3-6c13a7a9412f")>
>>> "selenium" in driver
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
"selenium" in driver
TypeError: argument of type 'WebDriver' is not iterable
>>> type (other_string)
<class 'str'>
>>> type (driver)
<class 'selenium.webdriver.ie.webdriver.WebDriver'>
尝试:
>>>"selenium" in str(driver)
或者也许更可靠:
>>>"selenium" in driver.__class__
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句