fewfwe
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import datetime
|
||||
import re
|
||||
import time
|
||||
import hmac
|
||||
import hashlib
|
||||
import base64
|
||||
import time
|
||||
from bs4 import BeautifulSoup
|
||||
import requests
|
||||
import json
|
||||
import requests
|
||||
@@ -238,16 +240,43 @@ class WeexTransaction:
|
||||
|
||||
if current_minute in [0, 30]: # 判断是否是 新的30分钟了
|
||||
|
||||
if self.page.ele('x://section[text()="仓位(1)"]', timeout=5):
|
||||
text = self.page.ele(
|
||||
'x://*[@id="tradeLimitContainerJS"]/div[2]/div/div[1]/div/div/div/div[5]/div/div/div[2]').text
|
||||
if "ETH/SUSDT 多" in text:
|
||||
self.start = 1
|
||||
elif "ETH/SUSDT 空" in text:
|
||||
self.start = -1
|
||||
|
||||
# 要匹配的目标文本
|
||||
target_text = "仓位(1)"
|
||||
|
||||
# 去除目标文本中的空白字符
|
||||
cleaned_target_text = re.sub(r'\s', '', target_text)
|
||||
|
||||
# 创建 BeautifulSoup 对象
|
||||
soup = BeautifulSoup(self.page.html, 'html.parser')
|
||||
|
||||
# 遍历所有标签的文本内容
|
||||
for tag in soup.find_all():
|
||||
tag_text = tag.get_text()
|
||||
# 去除标签文本中的空白字符
|
||||
cleaned_tag_text = re.sub(r'\s', '', tag_text)
|
||||
if cleaned_target_text in cleaned_tag_text:
|
||||
text = self.page.ele(
|
||||
'x://*[@id="tradeLimitContainerJS"]/div[2]/div/div[1]/div/div/div/div[5]/div/div/div[2]').text
|
||||
if "ETH/SUSDT 多" in text:
|
||||
self.start = 1
|
||||
break
|
||||
elif "ETH/SUSDT 空" in text:
|
||||
self.start = -1
|
||||
break
|
||||
else:
|
||||
self.start = 0
|
||||
|
||||
# if self.page.html:
|
||||
# text = self.page.ele(
|
||||
# 'x://*[@id="tradeLimitContainerJS"]/div[2]/div/div[1]/div/div/div/div[5]/div/div/div[2]').text
|
||||
# if "ETH/SUSDT 多" in text:
|
||||
# self.start = 1
|
||||
# elif "ETH/SUSDT 空" in text:
|
||||
# self.start = -1
|
||||
# else:
|
||||
# self.start = 0
|
||||
|
||||
new_price_datas = self.get_price()
|
||||
if new_price_datas:
|
||||
logger.success("获取最新交易价格成功!!!")
|
||||
|
||||
Reference in New Issue
Block a user