Commit 0a591668 authored by lzpp0221's avatar lzpp0221

添加项目文件。

parent 8ef03691
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>b8a6c428-7296-4a20-8035-09e649026dca</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>json_year.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>json+year</Name>
<RootNamespace>json+year</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="json_year.py" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "json+year", "json+year.pyproj", "{B8A6C428-7296-4A20-8035-09E649026DCA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B8A6C428-7296-4A20-8035-09E649026DCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B8A6C428-7296-4A20-8035-09E649026DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {940BE73B-DF2B-4850-B4D0-E072152D9A7C}
EndGlobalSection
EndGlobal
#coding=UTF-8
__author__ = "John Lee"
import json
import re
import datetime
today = datetime.datetime.today()
year = today.year
with open(r"d:\jjb.json", 'r',encoding='utf-8', errors='ignore') as f:
#str_json=f.read()
res = json.load(f)
#res = json.loads(str_json)
#print(res)
for i,ele in enumerate(res):
gengxinriqi=ele['gengxinriqi']
if i==0:
gengxinriqi_1=""
else:
gengxinriqi_1=res[i-1]['gengxinriqi'][0]
if ("01-01" in gengxinriqi[0]) and "01-01" not in gengxinriqi_1:
year=year-1
ele['gengxinriqi'][0] = str(year)+" "+gengxinriqi[0]
#str_json=json.dumps(res,indent=4,ensure_ascii=False)
with open(r"d:\jjb_g.json", 'w',encoding="utf-8") as f:
json.dump(res, f,indent=4,ensure_ascii=False)
#f.write(str_json)
#coding=UTF-8
__author__ = "John Lee"
import json
import re
import argparse
from airtest.core.api import *
from airtest.core.android.recorder import *
from airtest.core.android.adb import *
auto_setup(__file__,devices=["Android://127.0.0.1:5037/N7DEHURCAQTWIV9D"])
connect_device("Android:///N7DEHURCAQTWIV9D?cap_method=javacap&touch_method=adb")
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
def argp():
paser=argparse.ArgumentParser(prog="蚂蚁财富活动爬取",
description="这是一个实现爬取蚂蚁财富活动的命令行脚本",
usage="程序[%(prog)s] 实现了如下功能:爬取指定基金号的蚂蚁财富的活动信息,并存储在D盘",
epilog='暂无额外信息。');
paser.add_argument('-a', dest='a1', help='基金代码', type=str, required=True)
args = paser.parse_args()
return args
def caiji(jijindaima):
keyevent("HOME")
poco.wait_for_all(poco(text="支付宝"),timeout=10)
poco(text="支付宝").click()
sleep(5.0)
poco.click([0.45,0.06])
sleep(2)
poco("com.alipay.mobile.antui:id/search_bg").click()
text(jijindaima)
#text("007844")
poco("搜索").click()
sleep(3.0)
poco.click([0.28,0.12])
sleep(4.0)
poco.wait_for_all(poco(text="基金产品"),timeout=10)
poco.click([0.405,0.288])
sleep(8.0)
poco.click([0.07,0.89])
sleep(8.0)
while True:
if poco(textMatches=".*基金财富号活动专区").exists() and poco(textMatches=".*基金财富号活动专区").attr("pos")[1]<0.5:
break
poco.swipe([0.5,0.9],[0.5,0.4])
for i in poco(textMatches=".*基金财富号活动专区").parent().child():
if len(i.child())>=3:
item = i.child()
res={}
y = item[0].attr("pos")[1]
kuan = item[0].attr("size")[0]
dir = [0-kuan,0]
print(y)
print(kuan)
for n,i in enumerate(item):
print(i)
if True: #i.child(textMatches="参.*").exists():
key = i.child("android.view.View")[0].attr("text")
key1 = i.child("android.view.View")[1].attr("text")
print(key)
print(key1)
i.click()
sleep(10)
hd_detail=[]
hd_detail.append(key1)
for i in poco(textMatches="[\s\S]+"):
detail=i.attr("text").replace(u'\xa0', u' ').replace(u'\ue642', u' ')
print(detail)
hd_detail.append(detail)
poco("com.android.systemui:id/back").click()
sleep(2)
res[key]=hd_detail
poco.swipe([0.8, y], direction=dir)
print(res)
str_json=json.dumps(res,indent=4,ensure_ascii=False)
with open(r"d:\蚂蚁活动测试.json", 'w',encoding="utf-8") as f:
f.write(str_json)
stop_app("com.eg.android.AlipayGphone")
args = argp()
caiji(args.a1)
\ No newline at end of file
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>b7863e97-b78c-45d4-9398-fafe1e18b5ae</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>caiji.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>mayihuodongcaiji-daichuancan</Name>
<RootNamespace>mayihuodongcaiji-daichuancan</RootNamespace>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="caiji.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="mayihuodongcaiji_daichuancan.py" />
<Compile Include="module1.py">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "mayihuodongcaiji-daichuancan", "mayihuodongcaiji-daichuancan.pyproj", "{B7863E97-B78C-45D4-9398-FAFE1E18B5AE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B7863E97-B78C-45D4-9398-FAFE1E18B5AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7863E97-B78C-45D4-9398-FAFE1E18B5AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {90534E04-F080-4D41-A34B-8BCE094E2FA0}
EndGlobalSection
EndGlobal
import argparse
# 1.创建解释器
parser = argparse.ArgumentParser(description="可写可不写,只是在命令行参数出现错误的时候,随着错误信息打印出来。")
# 2.添加需要的参数
parser.add_argument('-gf', '--girlfriend', choices=['jingjing', 'lihuan'])
# 参数解释
# -gf 代表短选项,在命令行输入-gf和--girlfriend的效果是一样的,作用是简化参数输入
#--girlfriend 代表完整的参数名称,可以尽量做到让人见名知意,需要注意的是如果想通过解析后的参数取出该值,必须使用带--的名称
# choices 代表输入参数的只能是这个choices里面的内容,其他内容则会保错
parser.add_argument('--house', type=int, default=0)
# 参数解释
# --house 代表参数名称
# type 代表输入的参数类型,从命令行输入的参数,默认是字符串类型
# default 代表如果该参数不输入,则会默认使用该值
parser.add_argument('food')
# 参数解释
# 该种方式则要求必须输入该参数
# 输入该参数不需要指定参数名称,指定反而报错,解释器会自动将输入的参数赋值给food
# 3.进行参数解析
args = parser.parse_args()
print('------args---------',args)
print('-------gf-------', args.girlfriend)
#coding=UTF-8
__author__ = "John Lee"
import json
import re
import argparse
from airtest.core.api import *
from airtest.core.android.recorder import *
from airtest.core.android.adb import *
auto_setup(__file__,devices=["Android://127.0.0.1:5037/N7DEHURCAQTWIV9D"])
connect_device("Android:///N7DEHURCAQTWIV9D?cap_method=javacap&touch_method=adb")
#adb = ADB(serialno="N7DEHURCAQTWIV9D")
#recorder = Recorder(adb)
#recorder.start_recording(max_time=2000)
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
def argp():
paser=argparse.ArgumentParser(prog="蚂蚁财富活动爬取",
description="这是一个实现爬取蚂蚁财富活动的命令行脚本",
usage="程序[%(prog)s] 实现了如下功能:爬取指定基金号的蚂蚁财富的活动信息,并存储在D盘",
epilog='暂无额外信息。');
paser.add_argument('-a', dest='a1', help='基金代码', type=str, required=True)
args = paser.parse_args()
return args
args = argp()
keyevent("HOME")
poco.wait_for_all(poco(text = "支付宝"),timeout=10)
poco(text = "支付宝").click()
sleep(5.0)
poco.click([0.23,0.06])
sleep(8.0)
poco.click([0.23,0.06])
text(str(args.a1))
poco("搜索").click()
sleep(3.0)
poco.click([0.28,0.12])
sleep(8.0)
poco.wait_for_all(poco(text="基金产品"),timeout=10)
poco.click([0.405,0.288])
sleep(12.0)
poco.click([0.07,0.89])
sleep(8.0)
while True:
if poco(textMatches=".*基金财富号活动专区").exists() and poco(textMatches=".*基金财富号活动专区").attr("pos")[1]<0.5:
break
poco.swipe([0.5,0.9],[0.5,0.5],duration=2)
for i in poco(textMatches=".*基金财富号活动专区").parent().child():
if len(i.child())>=3:
item = i.child()
res={}
for n,i in enumerate(item):
print(i)
if True: #i.child(textMatches="参.*").exists():
key = i.child("android.view.View")[0].attr("text")
key1 = i.child("android.view.View")[1].attr("text")
print(key)
print(key1)
i.click()
sleep(10)
hd_detail=[]
hd_detail.append(key1)
for i in poco(textMatches="[\s\S]+"):
detail=i.attr("text").replace(u'\xa0', u' ').replace(u'\ue642', u' ')
print(detail)
hd_detail.append(detail)
poco("com.android.systemui:id/back").click()
sleep(10)
res[key]=hd_detail
if ((n+1)%3) == 0:
x, y = i.get_position()
dir = [-0.99,0]
poco.swipe([x, y], direction=dir)
print(res)
str_json=json.dumps(res,indent=4,ensure_ascii=False)
with open(r"d:\蚂蚁活动测试.json", 'w',encoding="utf-8") as f:
f.write(str_json)
stop_app("com.eg.android.AlipayGphone")
[]
{"dependencies":{"array_op":"1.0.0","datatable_op":"1.0.0","flags":"1.0.0","new_excel":"1.0.0","object_op":"1.0.0","system_function":"1.0.0","ui_automation":"1.0.0","var_op":"1.0.0"},"flowCnt":1,"codeCnt":4,"aiSkills":[],"flowInfos":{"/主流程.flow":{"0":{"lineNumber":0,"description":"","schemaBodyList":[{"bodyId":"body","codeList":[1,2,3]}]},"1":{"lineNumber":1,"description":"点击"},"2":{"lineNumber":2,"description":"输入文本"},"3":{"lineNumber":3,"description":"发送热键"}}},"flowCalls":{"/主流程.flow":{}},"input_param":[],"output_param":[],"top_level_process":[{"description":"点击","line_number":1,"child_line_number":[]},{"description":"输入文本","line_number":2,"child_line_number":[]},{"description":"发送热键","line_number":3,"child_line_number":[]}],"resources":[],"user_defined_structs":{}}
File added
File added
{"name":"testcmd","versionRange":"1.0.0","children":[],"nodeState":1}
{"id":"testcmd","displayName":"testcmd","moduleName":"testcmd","processList":[{"processType":"/主流程.flow","methodName":"/主流程.flow","displayName":"testcmd","content":[],"input":[],"output":[],"desc":"","disabled":false}]}
testcmd/.cyclone/snapshots/1b26a6ca-a71d-49f3-9273-de6c8948c7f4.bmp

442 Bytes

testcmd/.cyclone/snapshots/3595c14b-c54a-4b9a-af82-8712eac553ea.bmp

466 Bytes

testcmd/.cyclone/snapshots/601647f1-79a5-4698-b46d-6aaa0199e4de.png

2.29 KB

testcmd/.cyclone/snapshots/aa7cf34b-3a98-4054-9f03-3600d88dc07b.png

2.3 KB

{
"name": "testcmd",
"description": "",
"manual": "",
"outputType": "project",
"main": "/主流程.flow",
"version": "1.0.0",
"engines": {
"designer": "5.0.RC",
"server": "5.0.RC",
"executor-runtime": "4.2.0"
},
"uuid": "28c928ca-069a-41a5-8f0e-d16b2e80f90f",
"dependencies": {}
}
\ No newline at end of file
File added
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>818b2e35-97e3-4656-83f8-449fb6658bdd</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>jjb.py</StartupFile>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<Name>ttjj</Name>
<RootNamespace>ttjj</RootNamespace>
<InterpreterId>Global|PythonCore|3.10</InterpreterId>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
</PropertyGroup>
<ItemGroup>
<Compile Include="items.py" />
<Compile Include="jjb.py" />
<Compile Include="ttjj.py" />
</ItemGroup>
<ItemGroup>
<InterpreterReference Include="Global|PythonCore|3.10" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
<!-- Uncomment the CoreCompile target to enable the Build command in
Visual Studio and specify your pre- and post-build commands in
the BeforeBuild and AfterBuild targets below. -->
<!--<Target Name="CoreCompile" />-->
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "ttjj", "ttjj.pyproj", "{818B2E35-97E3-4656-83F8-449FB6658BDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{818B2E35-97E3-4656-83F8-449FB6658BDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{818B2E35-97E3-4656-83F8-449FB6658BDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {99391A4A-7BE7-42D5-B67A-F7B06956E153}
EndGlobalSection
EndGlobal
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment