From 4c2364b08a361be0be188d78ec82497b15994e11 Mon Sep 17 00:00:00 2001 From: g1879 Date: Wed, 14 Apr 2021 09:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/drission.py | 2 +- DrissionPage/driver_element.py | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/DrissionPage/drission.py b/DrissionPage/drission.py index 2a1862c..2b4904c 100644 --- a/DrissionPage/drission.py +++ b/DrissionPage/drission.py @@ -392,7 +392,7 @@ def _create_chrome(chrome_path: str, port: str, args: list, proxy: dict) -> tupl else: args1.append(arg) - args = ' '.join(args1) + args = ' '.join(set(args1)) if proxy: args = f'{args} --proxy-server={proxy["http"]}' diff --git a/DrissionPage/driver_element.py b/DrissionPage/driver_element.py index 2f92282..f8c6e1c 100644 --- a/DrissionPage/driver_element.py +++ b/DrissionPage/driver_element.py @@ -777,7 +777,12 @@ class ElementsByXpath(object): class Select(object): + """Select 类专门用于处理 d 模式下 select 标签""" + def __init__(self, ele: DriverElement): + """初始化 \n + :param ele: select 元素对象 + """ if ele.tag != 'select': raise TypeError(f"Select only works on