TA的每日心情 | 无聊 4 天前 |
---|
签到天数: 530 天 连续签到: 2 天 [LV.9]测试副司令
|
1测试积点
在学习selenium时尝试无头启动Edge浏览器但是始终不成功
源码
- import time
- from selenium import webdriver
- from selenium.webdriver.edge.options import Options
-
- options = Options()
- options.add_argument("headless")
-
- driver = webdriver.Edge(options = options)
- driver.get('http://bing.com')
- print('载入成功')
- time.sleep(2)
- driver.quit()
复制代码 报错
- Traceback (most recent call last):
- File "D:\xxx\xxx.py", line 6, in
- options.add_argument("headless")
- AttributeError: 'Options' object has no attribute 'add_argument'
复制代码
|
|