Uiautomation implements CSDN synchronization article to community optimization

Synchronize the latest articles to the community

The updated place is: when the arrow is pressed, it has been changed into two parts, the first half is pressed by the arrow, and the second half of the community is synchronized by pressing the up arrow to improve efficiency. The synchronization of 31 communities is reduced from the original 360s to 230s

import uiautomation as auto
import time
"""
更新的地方为:在按下箭头时候,这里改成了两部分,前半部分按下箭头,后半部分社区通过按上箭头实现同步,提高效率,同步31个社区由原来的360s减少到230s"""
# TODO
"""TODO首先程序提供2秒钟,需要你将页面显示在CSDN的内容管理页面
https://mp.csdn.net/mp_blog/manage/article"""
time.sleep(2)
"""时间开始记录以及运行时间记录,最后运行时间显示单位为秒"""
start_time = time.time()
print('开始时间:{}'.format(start_time))
# 将全局超时设置为3秒
auto.SetGlobalSearchTimeout(3)
content = auto.DocumentControl(Name="内容管理-CSDN创作中心", Classname="Chrome_RenderWidgetHostHWND")

tongbu = content.EditControl(Name="同步至社区")
"""下面两个tongbu.Click()之间的内容是用来确定社区名称,社区数量"""
# 同步至社区按钮若存在则点

Guess you like

Origin blog.csdn.net/knighthood2001/article/details/132301300