File size: 1,672 Bytes
61a25a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import subprocess
import sys
import time
import json
from appium.webdriver.common.touch_action import TouchAction
# from appium.webdriver.common.mobileby import MobileBy
from selenium.webdriver.common.by import By
from appium.webdriver.common.mobileby import MobileBy
from appium import webdriver

from agent_for_api.API_list import usr_api_list
from agent_for_api.agent_api_prompt import select_api_prompt, select_api_example
from agent_for_api.main_for_api import get_api_list
from data_prompt import *
from app_list import *
from agent_for_api.API_list import *
from selenium.common.exceptions import WebDriverException, InvalidElementStateException, NoSuchElementException

from app_list import app_list
from chatgpt import chatgpt
import re

if __name__ == '__main__':
    # prompt = data_prompt.format(task_description=multiapp_description,
    #                                         examples=multiapp_examples, app_list=app_list, api_list=usr_api_list, requirement=multiapp_requirement)
    # # print(prompt)
    # res = chatgpt(prompt)[0]
    # # print(res)
    # with open("data_instruction.txt", "a") as outfile:
    #     outfile.write(res)
    with open('s_app_s_step.json', 'r', encoding='UTF-8') as file:
        data = json.load(file)
    # 使用字典统计每个domain的数量
    domain_count = {}
    for item in data:
        domain = item['domain']
        if domain in domain_count:
            domain_count[domain] += 1
        else:
            domain_count[domain] = 1
    # 输出结果
    print(len(domain_count))
    for domain, count in domain_count.items():
        print(f"{domain}: {count}")