This commit is contained in:
Administrator
2025-12-02 16:18:04 +08:00
parent f177c9143a
commit 2c9ea4db65

View File

@@ -200,21 +200,6 @@ class WeexTransaction:
self.mn_tab.ele('x://*[contains(text(), "市价")]', timeout=15).click()
time.sleep(1)
html_text = self.remove_tags_and_spaces(html=self.mn_tab.html)
# 定义正则表达式模式,用于匹配包含逗号和小数点的数值
pattern = r'可用:([\d,]+\.\d+)USDT'
# 使用 re.search 方法查找匹配项
match = re.search(pattern, html_text)
number = ""
if match:
# 提取匹配到的数值字符串
number_str = match.group(1).replace(',', '')
# 将提取的字符串转换为浮点数
number = float(number_str)
if not number:
return
self.mn_tab.ele('x://*[@id="amountInput"]').input(float(self.get_num()) / 100)
time.sleep(1)
@@ -311,7 +296,7 @@ class WeexTransaction:
res = num_tab.listen.wait(timeout=15) # 等待并获取一个数据包
if res:
return res.response["result"]["availableUsd"]
return res.response.body["result"]["availableUsd"]
except:
pass
@@ -359,8 +344,8 @@ class WeexTransaction:
self.pbar.n = current_minute - 30
self.pbar.refresh()
# if current_minute not in [0, 1, 2, 3, 4, 5, 30, 31, 32, 33, 34, ]: # 判断是否是 新的30分钟了
if current_minute not in range(60): # 判断是否是 新的30分钟了
if current_minute not in [0, 1, 2, 3, 4, 5, 30, 31, 32, 33, 34, ]: # 判断是否是 新的30分钟了
# if current_minute not in range(60): # 判断是否是 新的30分钟了
time.sleep(10)
continue