Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Export browser HAR data using chrome-har

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

< dataArr.length){ iterator(i+1) ; } })(0) ; }); console.log('应用程序启动完成') ;}//执行//init();/** 用于测试的方法*/async function test(){ let ftime = moment().format('YYYYMMDDHHmm'); console.log('当前执行时间为:' + ftime) ; let dirPath = path.join(__dirname,'harlogs',ftime) ; console.log("创建目录:" + dirPath) ; let isExist = false ; if(fs.existsSync(dirPath)){ //创建文件夹 let stat = fs.lstatSync(dirPath); if(stat.isDirectory()){ isExist = true ; } } if(!isExist){ //创建文件夹 console.log("创建文件夹" + ftime) ; fs.mkdirSync(dirPath); } //测试的URL let url = "www.baidu.com" ; let arguments = process.argv.splice(2); if(arguments.length >

0) {url = arguments [0];} url = url.trim (); let filename = url.replace (/\ / / g maijinghui'). Replace (/\ / gjinghui') + '.har'; if (url) {console.log ("starting to resovle test url:" + url) Try {await mhar.saveHarlog (url,dirPath, "NT" + "-" + filename);} catch (error) {console.log (error);} / / run the test test ()

For the code in the GRPC section, please refer to my other blog post

Reference address: https://michaljanaszek.com/blog/generate-har-with-puppeteer

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report