gui
第一版完整版
This commit is contained in:
8
自动化.py
8
自动化.py
@@ -272,6 +272,9 @@ class Pdd:
|
||||
self.create_page()
|
||||
|
||||
datas = self.get_page_datas()
|
||||
if not datas:
|
||||
logger.error("未获取到页面数据,无法继续")
|
||||
return
|
||||
|
||||
self.page.get(url="https://mcn.pinduoduo.com/register")
|
||||
|
||||
@@ -329,14 +332,15 @@ class Pdd:
|
||||
)
|
||||
|
||||
time.sleep(3)
|
||||
creator_tab.ele('x://*[@placeholder="添加标题"]').input(vals=datas["title"], clear=True)
|
||||
creator_tab.ele('x://*[@placeholder="添加标题"]').input(vals=datas.get("title", ""), clear=True)
|
||||
time.sleep(3)
|
||||
|
||||
xpath_path = creator_tab.ele('x://*[text()="添加视频描述"]').xpath
|
||||
# 方法2:使用正则表达式替换最后一个div[1]
|
||||
new_path = re.sub(r'div\[1\]$', 'div[2]', xpath_path)
|
||||
new_path += "/div/div[3]/div/div/div"
|
||||
creator_tab.ele(f'x:{new_path}').input(vals=datas["desc"].replace("[话题]", "")[:450], clear=True)
|
||||
desc_text = (datas.get("desc") or "").replace("[话题]", "")[:450]
|
||||
creator_tab.ele(f'x:{new_path}').input(vals=desc_text, clear=True)
|
||||
|
||||
# 定时
|
||||
if self.time_start:
|
||||
|
||||
Reference in New Issue
Block a user