赞
踩
互联网上基本都是某哥的用法,其实edge和某哥的用法是一样的就有一下参数不一样。
一、运行环境
Python:3.7
Selenium:4.11.2
Edge:版本 120.0.2210.61 (正式版本) (64 位)
二、执行代码
- from time import sleep
-
- from selenium import webdriver
-
- # 在这里导入浏览器设置相关的类
- from selenium.webdriver.common.by import By
- from selenium.webdriver.edge.options import Options
-
-
- uName = "亚丁号"
- pWord="https://www.yadinghao.com/"
-
- class HWStoreBusiness:
-
-
-
-
-
- def purchase(self):
- down_path = "D:\\Temp"
- diy_prefs = {'profile.default_content_settings.popups': 0,'download.default_directory': '{0}'.format(down_path)}
- edge_options = Options()
- # 使用无头模式
- # edge_options.add_argument('--headless')# 无可视化界面设置 #
- # 禁用GPU,防止无头模式出现莫名的BUG
- # edge_options.ad

Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。