修复选中的下拉选项再点击取消的问题;quit()内加入waitpid()

This commit is contained in:
g1879 2024-03-26 23:26:54 +08:00
parent d010ab35ef
commit f8c77b76e7
4 changed files with 10 additions and 11 deletions

View File

@ -1,6 +1,6 @@
在提交issue前请确认已经给本库点了星星这对我来说很重要。
使用方法请查看[使用文档](http://g1879.gitee.io/drissionpagedocs),文档里都有。
使用方法请查看[使用文档](http://drissionpage.cn),文档里都有。
也可在QQ群里提问636361957
请围绕以下内容陈述您的问题:

View File

@ -5,6 +5,7 @@
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
@License : BSD 3-Clause.
"""
from os import waitpid
from pathlib import Path
from shutil import rmtree
from time import perf_counter, sleep
@ -273,6 +274,8 @@ class Browser(object):
if ok:
break
if self.process_id:
waitpid(self.process_id, 0)
def _on_disconnect(self):
self.page._on_disconnect()

View File

@ -37,10 +37,12 @@ class Clicker(object):
:return: 是否点击成功
"""
if self._ele.tag == 'option':
if self._ele.states.is_selected:
self._ele.parent('t:select').select.cancel_by_option(self._ele)
else:
if not self._ele.states.is_selected:
self._ele.parent('t:select').select.by_option(self._ele)
else:
select = self._ele.parent('t:select')
if select.select.is_multi:
self._ele.parent('t:select').select.cancel_by_option(self._ele)
return
if not by_js: # 模拟点击

View File

@ -30,7 +30,7 @@ Supported browsers: Chromium core browsers (such as Chrome and Edge), electron a
# 🛠 How to use
**📖 Usage documentation:** [Click to view](https://g1879.gitee.io/drissionpagedocs)
**📖 Usage documentation:** [Click to view](https://drissionpage.cn)
**Communication QQ group:** 636361957
@ -89,12 +89,6 @@ In addition to the above advantages, this library also has numerous built-in hum
---
# 🔖 Version History
[Click to view version history](https://g1879.gitee.io/drissionpagedocs/history/introduction/)
---
# 🖐🏻 Disclaimer
Please do not apply DrissionPage to any work that may violate legal regulations and moral constraints. Please use DrissionPage in a friendly manner, comply with the spider agreement, and do not use DrissionPage for any illegal purposes. If you choose to use DrissionPage