最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python爬蟲MeterSphere平臺執(zhí)行報(bào)告使用進(jìn)階

 更新時(shí)間:2023年12月25日 11:06:03   作者:友友測試猿,小蔡  
這篇文章主要為大家介紹了python爬蟲MeterSphere平臺執(zhí)行報(bào)告使用進(jìn)階示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

一、MeterSphere報(bào)告首頁數(shù)據(jù)獲取 

1、獲取首頁數(shù)據(jù)

2、過濾獲取到的內(nèi)容

#測試報(bào)告首頁
TestReportResp = requests.post(url=TestReportUrl,json=TestReportDate, headers=TestReportHeaders)
TestReportResp.encoding = "utf-8"
TestReporReturn=TestReportResp.text
#print(TestReporReturn)
TestReporSet=re.findall('"id":"(.+?)",',TestReporReturn)
#print(TestReporSet)
#獲取場景名稱+結(jié)束時(shí)間
GetSceneName=re.findall('","name":"(.+?)","createTime"',TestReporReturn)
#print(GetSceneName)
#獲取創(chuàng)建時(shí)間
#獲取結(jié)束時(shí)間
#獲取出發(fā)方式
#獲取狀態(tài)
GetState=re.findall(',"status":"(.+?)","userId"',TestReporReturn)

二、表格創(chuàng)建及首頁所有場景字段過濾后取值

1、在獲取數(shù)據(jù)前創(chuàng)建存儲表格

2、通過循環(huán)下標(biāo)取值

# 清空表格
newb = xlwt.Workbook(encoding='utf-8')  # 創(chuàng)建新的工作簿
nws = newb.add_sheet('Sheet1')  # 添加工作表
newb.save('autoinsurancereport.xls')  # 保存工作簿
for countRepor in range(0, len(TestReporSet)):
    # 控制場景名稱和狀態(tài)總數(shù)
    GetSceneNamecount=int(countRepor)
    ++GetSceneNamecount
    #場景名稱
    GetSceneNameGain=str(GetSceneName[GetSceneNamecount])
    print("場景名稱:"+GetSceneNameGain)
    #場景狀態(tài)
    GetStateGain=str(GetState[GetSceneNamecount])
    print("場景狀態(tài):"+GetStateGain)

三、通過商業(yè)過濾值后進(jìn)行拼接訪問詳情頁獲取報(bào)告信息

1、通過首頁每個(gè)場景唯一id進(jìn)行與詳情地址拼接訪問

# 獲取詳情報(bào)告地址拼接
ReportParticulars = str(TestReporSet[countRepor])
# print(ReportParticulars)
ReportParticularsUrl = "http://ms.***.*****:****/api/scenario/report/get/" + ReportParticulars
print("場景地址:"+ReportParticularsUrl)
ReportParticularsResp = requests.get(url=ReportParticularsUrl, headers=TestReportHeaders)
ReportParticularsResp.encoding = "utf=8"
print("==============")
print(ReportParticularsResp.text)
ReportParticularsRespGet = ReportParticularsResp.text
# 獲取每個(gè)響應(yīng)體地址拼接
TestReporTG = re.findall('"stepId(.+?)\",', ReportParticularsRespGet)
# print(TestReporTG)
# 因?yàn)楂@取地址最后一個(gè)地址為非有效,進(jìn)行過濾處理
TestReporTgCount = int(len(TestReporTG))
TestReporTgCount001 = TestReporTgCount - 1

以上就是python爬蟲MeterSphere平臺執(zhí)行報(bào)告使用進(jìn)階的詳細(xì)內(nèi)容,更多關(guān)于python爬蟲MeterSphere的資料請關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評論

罗平县| 蓝山县| 舒城县| 新疆| 清苑县| 嘉禾县| 罗甸县| 彭阳县| 彩票| 玉门市| 紫阳县| 余庆县| 永福县| 江陵县| 全椒县| 鄂尔多斯市| 北碚区| 郸城县| 晋城| 海原县| 边坝县| 恩平市| 河南省| 泗阳县| 文化| 凤山县| 诏安县| 时尚| 惠水县| 通榆县| 林西县| 布尔津县| 昭通市| 土默特左旗| 兴海县| 涡阳县| 百色市| 肃北| 龙岩市| 武穴市| 芦山县|