临时提交

This commit is contained in:
zw
2025-08-12 18:53:06 +08:00
parent 747126f1f8
commit 1ce16cff46
5 changed files with 102 additions and 31 deletions

View File

@@ -124,7 +124,7 @@ class ControlUtils(object):
# 获取关注按钮
@classmethod
def clickFollowButton(cls, session: Client):
followButton = session.xpath('//Window[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[2]/Other[2]/Other[1]/Other[1]/Other[3]/Other[1]/Other[1]/Button[1]')
followButton = session.xpath("//Window[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[1]/Other[2]/Other[2]/Other[1]/Other[1]/Other[3]/Other[1]/Other[1]/Button[1]")
if followButton.exists:
print("找到了")
followButton.click()

View File

@@ -1,7 +1,45 @@
from Entity.Variables import accountToken
import requests
from Entity.Variables import accountToken, prologueList
# BaseUrl = "https://crawlclient.api.yolozs.com/api/common/"
BaseUrl = "http://192.168.1.174:8101/api/common/"
class Requester():
comment = "comment"
prologue = "prologue"
@classmethod
def printToken(cls):
print(accountToken)
def requestComments(cls):
headers = {
"vvtoken": accountToken,
}
url = BaseUrl + cls.prologue
result = requests.get(headers=headers, url=url)
json = result.json()
data = json.get("data")
for i in data:
prologueList.append(i)
# 翻译
@classmethod
def translation(cla, msg, country="英国"):
parame = {
"msg":msg,
"country":country,
}
url = "http://ai.zhukeping.com/translation"
result = requests.request(url=url, json=parame, method="POST")
json = result.json()
data = json.get("data")
print(data)
return data
# ai聊天
@classmethod
def chatToAi(cls, param):
url = "http://ai.zhukeping.com/chat"
result = requests.request(url=url, json=param, method="POST")
json = result.json()
data = json.get("data", {})
return data