Java教程

Java如何爬虫奥运奖牌榜数据,恭喜中国获得东京奥运会首金!

本文主要是介绍Java如何爬虫奥运奖牌榜数据,恭喜中国获得东京奥运会首金!,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!


2020年的东京奥运会在2021年7月23日开幕了。

2021年7月24日上午,中国的00后选手杨倩,获得了女子10米气步枪的金牌,未来可期,恭喜!

看到如此激动人心的消息,你是否想要获取奥运会的奖牌榜数据呢?

本文带你使用Java>>>来进行爬虫获取2020年东京奥运奖牌榜的数据。

首金

然后我们可以打开浏览器的调试工具,查看网络请求并分析源代码,然后找到如下相关的代码:

页面配置

通过对变量的分析与判断,可以知道了4个URL信息,即国家的信息、比赛项目的信息、比赛日期的信息、奖牌榜数据的信息。

对于截图中的medalPage.js文件,通过分析可以知道是负责处理奖牌榜相关请求与页面渲染的主要文件,感兴趣的深入学习研究。

我们可以通过浏览器单独访问这几个接口,获得相关返回的JSON数据,各个请求如下:

国家请求:

{"result":{"status":{"code":0,"msg":"olympic country"},"timestamp":"Thu Aug 05 10:56:20 +0800 2021","data":{"AFG":"\u963f\u5bcc\u6c57","AHO":"\u8377\u5c5e\u5b89\u7684\u5217\u65af","AIA":"\u5b89\u572d\u62c9","ALA":"\u5965\u5170\u7fa4\u5c9b","ALB":"\u963f\u5c14\u5df4\u5c3c\u4e9a","ALG":"\u963f\u5c14\u53ca\u5229\u4e9a","AND":"\u5b89\u9053\u5c14","ANG":"\u5b89\u54e5\u62c9","ANT":"\u5b89\u63d0\u74dc\u548c\u5df4\u5e03\u8fbe","ANZ":"\u6fb3\u6d32\/\u65b0\u897f\u5170","ARG":"\u963f\u6839\u5ef7","ARM":"\u4e9a\u7f8e\u5c3c\u4e9a","ARU":"\u963f\u9c81\u5df4","ASA":"\u7f8e\u5c5e\u8428\u6469\u4e9a","ATA":"\u5357\u6781\u6d32","ATF":"\u6cd5\u5c5e\u5357\u90e8\u9886\u5730","AUS":"\u6fb3\u5927\u5229\u4e9a","AUT":"\u5965\u5730\u5229","AZE":"\u963f\u585e\u62dc\u7586","BAH":"\u5df4\u54c8\u9a6c","BAN":"\u5b5f\u52a0\u62c9\u56fd","BAR":"\u5df4\u5df4\u591a\u65af","BDI":"\u5e03\u9686\u8fea","BEL":"\u6bd4\u5229\u65f6","BEN":"\u8d1d\u5b81","BER":"\u767e\u6155\u5927","BES":"\u6ce2\u5167\u8d6b\u3001\u5723\u5c24\u65af\u7279\u6b47\u65af\u548c\u8428\u5df4","BHU":"\u4e0d\u4e39","BIH":"\u6ce2\u9ed1","BIZ":"\u4f2f\u5229\u5179","BLM":"\u5723\u5df4\u6cf0\u52d2\u7c73\u5c9b","BLR":"\u767d\u4fc4\u7f57\u65af","BOL":"\u73bb\u5229\u7ef4\u4e9a","BOT":"\u535a\u8328\u74e6\u7eb3","BRA":"\u5df4\u897f","BRN":"\u5df4\u6797","BRU":"\u6587\u83b1","BUL":"\u4fdd\u52a0\u5229\u4e9a","BUR":"\u5e03\u57fa\u7eb3\u6cd5\u7d22","BVT":"\u5e03\u97e6\u5c9b","CAF":"\u4e2d\u975e","CAM":"\u67ec\u57d4\u5be8","CAN":"\u52a0\u62ff\u5927","CAY":"\u5f00\u66fc\u7fa4\u5c9b","CCK":"\u79d1\u79d1\u65af\uff08\u57fa\u6797\uff09\u7fa4\u5c9b","CGO":"\u521a\u679c\uff08\u5e03\uff09","CHA":"\u4e4d\u5f97","CHI":"\u667a\u5229","CHN":"\u4e2d\u56fd","CIS":"\u72ec\u7acb\u56fd\u5bb6\u8054\u5408\u4f53","CIV":"\u79d1\u7279\u8fea\u74e6","CMR":"\u5580\u9ea6\u9686","COD":"\u521a\u679c\uff08\u91d1\uff09","COK":"\u5e93\u514b\u7fa4\u5c9b","COL":"\u54e5\u4f26\u6bd4\u4e9a","COM":"\u79d1\u6469\u7f57","COR":"\u671d\u9c9c","CPV":"\u4f5b\u5f97\u89d2","CRC":"\u54e5\u65af\u8fbe\u9ece\u52a0","CRO":"\u514b\u7f57\u5730\u4e9a","CUB":"\u53e4\u5df4","CUW":"\u5e93\u62c9\u7d22","CXR":"\u5723\u8bde\u5c9b","CYP":"\u585e\u6d66\u8def\u65af","CZE":"\u6377\u514b","DEN":"\u4e39\u9ea6","DJI":"\u5409\u5e03\u63d0","DMA":"\u591a\u7c73\u5c3c\u514b","DOM":"\u591a\u7c73\u5c3c\u52a0","ECU":"\u5384\u74dc\u591a\u5c14","EGY":"\u57c3\u53ca","EOR":"\u96be\u6c11\u4ee3\u8868\u56e2","ERI":"\u5384\u7acb\u7279\u91cc\u4e9a","ESA":"\u8428\u5c14\u74e6\u591a","ESH":"\u897f\u6492\u54c8\u62c9","ESP":"\u897f\u73ed\u7259","EST":"\u7231\u6c99\u5c3c\u4e9a","ETH":"\u57c3\u585e\u4fc4\u6bd4\u4e9a","EUN":"\u8054\u5408\u961f","FIJ":"\u6590\u6d4e","FIN":"\u82ac\u5170","FLK":"\u798f\u514b\u5170\u7fa4\u5c9b","FRA":"\u6cd5\u56fd","FRG":"\u8054\u90a6\u5fb7\u56fd","FRO":"\u6cd5\u7f57\u7fa4\u5c9b","FSM":"\u5bc6\u514b\u7f57\u5c3c\u897f\u4e9a","GAB":"\u52a0\u84ec","GAM":"\u5188\u6bd4\u4e9a","GBR":"\u82f1\u56fd","GBS":"\u51e0\u5185\u4e9a\u6bd4\u7ecd","GDR":"\u6c11\u4e3b\u5fb7\u56fd","GEO":"\u683c\u9c81\u5409\u4e9a","GEQ":"\u8d64\u9053\u51e0\u5185\u4e9a","GER":"\u5fb7\u56fd","GGY":"\u6839\u897f","GHA":"\u52a0\u7eb3","GIB":"\u76f4\u5e03\u7f57\u9640","GLP":"\u74dc\u5fb7\u7f57\u666e","GRE":"\u5e0c\u814a","GRL":"\u683c\u9675\u5170","GRN":"\u683c\u6797\u7eb3\u8fbe","GUA":"\u5371\u5730\u9a6c\u62c9","GUF":"\u6cd5\u5c5e\u572d\u4e9a\u90a3","GUI":"\u51e0\u5185\u4e9a","GUM":"\u5173\u5c9b","GUY":"\u572d\u4e9a\u90a3","HAI":"\u6d77\u5730","HKG":"\u4e2d\u56fd\u9999\u6e2f","HMD":"\u8d6b\u5fb7\u5c9b\u548c\u9ea6\u514b\u5510\u7eb3\u7fa4\u5c9b","HON":"\u6d2a\u90fd\u62c9\u65af","HUN":"\u5308\u7259\u5229","IMN":"\u9a6c\u6069\u5c9b","INA":"\u5370\u5ea6\u5c3c\u897f\u4e9a","IND":"\u5370\u5ea6","IOA":"\u72ec\u7acb\u5965\u6797\u5339\u514b\u8fd0\u52a8\u5458","IOP":"\u72ec\u7acb\u5965\u6797\u5339\u514b\u53c2\u8d5b\u8005","IOT":"\u82f1\u5c5e\u5370\u5ea6\u6d0b\u9886\u5730","IPA":"\u72ec\u7acb\u6b8b\u5965\u8fd0\u52a8\u5458","IPP":"\u72ec\u7acb\u6b8b\u5965\u53c2\u8d5b\u8005","IRI":"\u4f0a\u6717","IRL":"\u7231\u5c14\u5170","IRQ":"\u4f0a\u62c9\u514b","ISL":"\u51b0\u5c9b","ISR":"\u4ee5\u8272\u5217","ISV":"\u7f8e\u5c5e\u7ef4\u5c14\u4eac\u7fa4\u5c9b","ITA":"\u610f\u5927\u5229","IVB":"\u82f1\u5c5e\u7ef4\u5c14\u4eac\u7fa4\u5c9b","JAM":"\u7259\u4e70\u52a0","JER":"\u6cfd\u897f\u5c9b","JOR":"\u7ea6\u65e6","JPN":"\u65e5\u672c","KAZ":"\u54c8\u8428\u514b\u65af\u5766","KEN":"\u80af\u5c3c\u4e9a","KGZ":"\u5409\u5c14\u5409\u65af\u65af\u5766","KIR":"\u57fa\u91cc\u5df4\u65af","KOR":"\u97e9\u56fd","KOS":"\u79d1\u7d22\u6c83","KSA":"\u6c99\u7279\u963f\u62c9\u4f2f","KUW":"\u79d1\u5a01\u7279","LAO":"\u8001\u631d","LAT":"\u62c9\u8131\u7ef4\u4e9a","LBA":"\u5229\u6bd4\u4e9a","LBN":"\u9ece\u5df4\u5ae9","LBR":"\u5229\u6bd4\u91cc\u4e9a","LCA":"\u5723\u5362\u897f\u4e9a","LES":"\u83b1\u7d22\u6258","LIE":"\u5217\u652f\u6566\u58eb\u767b","LTU":"\u7acb\u9676\u5b9b","LUX":"\u5362\u68ee\u5821","MAC":"\u4e2d\u56fd\u6fb3\u95e8","MAD":"\u9a6c\u8fbe\u52a0\u65af\u52a0","MAF":"\u6cd5\u5c5e\u5723\u9a6c\u4e01","MAR":"\u6469\u6d1b\u54e5","MAS":"\u9a6c\u6765\u897f\u4e9a","MAW":"\u9a6c\u62c9\u7ef4","MDA":"\u6469\u5c14\u591a\u74e6","MDV":"\u9a6c\u5c14\u4ee3\u592b","MEX":"\u58a8\u897f\u54e5","MGL":"\u8499\u53e4","MHL":"\u9a6c\u7ecd\u5c14\u7fa4\u5c9b","MKD":"\u5317\u9a6c\u5176\u987f","MLI":"\u9a6c\u91cc","MLT":"\u9a6c\u8033\u4ed6","MNE":"\u9ed1\u5c71","MNP":"\u5317\u9a6c\u91cc\u4e9a\u7eb3\u7fa4\u5c9b","MON":"\u6469\u7eb3\u54e5","MOZ":"\u83ab\u6851\u6bd4\u514b","MRI":"\u6bdb\u91cc\u6c42\u65af","MSR":"\u8499\u585e\u62c9\u7279\u5c9b","MTN":"\u6bdb\u91cc\u5854\u5c3c\u4e9a","MTQ":"\u9a6c\u63d0\u5c3c\u514b","MYA":"\u7f05\u7538","MYT":"\u9a6c\u7ea6\u7279","NAM":"\u7eb3\u7c73\u6bd4\u4e9a","NCA":"\u5c3c\u52a0\u62c9\u74dc","NCL":"\u65b0\u5580\u91cc\u591a\u5c3c\u4e9a","NED":"\u8377\u5170","NEP":"\u5c3c\u6cca\u5c14","NFK":"\u8bfa\u798f\u514b\u5c9b","NGR":"\u5c3c\u65e5\u5229\u4e9a","NIG":"\u5c3c\u65e5\u5c14","NIU":"\u7ebd\u57c3","NOR":"\u632a\u5a01","NRU":"\u7459\u9c81","NZL":"\u65b0\u897f\u5170","OMA":"\u963f\u66fc","PAK":"\u5df4\u57fa\u65af\u5766","PAN":"\u5df4\u62ff\u9a6c","PAR":"\u5df4\u62c9\u572d","PCN":"\u76ae\u7279\u51ef\u6069\u7fa4\u5c9b","PER":"\u79d8\u9c81","PHI":"\u83f2\u5f8b\u5bbe","PLE":"\u5df4\u52d2\u65af\u5766","PLW":"\u5e15\u52b3","PNG":"\u5df4\u5e03\u4e9a\u65b0\u51e0\u5185\u4e9a","POL":"\u6ce2\u5170","POR":"\u8461\u8404\u7259","PRK":"\u671d\u9c9c","PUR":"\u6ce2\u591a\u9ece\u5404","PYF":"\u6cd5\u5c5e\u6ce2\u5229\u5c3c\u897f\u4e9a","QAT":"\u5361\u5854\u5c14","REU":"\u7559\u5c3c\u6c6a","ROC":"ROC","ROU":"\u7f57\u9a6c\u5c3c\u4e9a","RSA":"\u5357\u975e","RUS":"\u4fc4\u7f57\u65af","RWA":"\u5362\u65fa\u8fbe","SAM":"\u8428\u6469\u4e9a","SCG":"\u585e\u9ed1","SEN":"\u585e\u5185\u52a0\u5c14","SEY":"\u585e\u820c\u5c14","SGP":"\u65b0\u52a0\u5761","SGS":"\u5357\u4e54\u6cbb\u4e9a\u5c9b&\u5357\u6851\u5a01\u5947\u7fa4\u5c9b","SHN":"\u5723\u8d6b\u52d2\u62ff\u5c9b","SJM":"\u65af\u74e6\u5df4\u548c\u626c\u9a6c\u5ef6","SKN":"\u5723\u57fa\u8328\u548c\u5c3c\u7ef4\u65af","SLE":"\u585e\u62c9\u5229\u6602","SLO":"\u65af\u6d1b\u6587\u5c3c\u4e9a","SMR":"\u5723\u9a6c\u529b\u8bfa","SOL":"\u6240\u7f57\u95e8\u7fa4\u5c9b","SOM":"\u7d22\u9a6c\u91cc","SPM":"\u5723\u76ae\u57c3\u5c14\u548c\u5bc6\u514b\u9686","SRB":"\u585e\u5c14\u7ef4\u4e9a","SRI":"\u65af\u91cc\u5170\u5361","SSD":"\u5357\u82cf\u4e39","STP":"\u5723\u591a\u7f8e & \u666e\u6797\u897f\u6bd4","SUD":"\u82cf\u4e39","SUI":"\u745e\u58eb","SUR":"\u82cf\u91cc\u5357","SVK":"\u65af\u6d1b\u4f10\u514b","SWE":"\u745e\u5178","SWZ":"\u65af\u5a01\u58eb\u5170","SXM":"\u8377\u5c5e\u5723\u9a6c\u4e01","SYR":"\u53d9\u5229\u4e9a","TAN":"\u5766\u6851\u5c3c\u4e9a","TCA":"\u7279\u514b\u65af\u548c\u51ef\u79d1\u65af\u7fa4\u5c9b","TCH":"\u6377\u514b\u65af\u6d1b\u4f10\u514b","TGA":"\u6c64\u52a0","THA":"\u6cf0\u56fd","TJK":"\u5854\u5409\u514b\u65af\u5766","TKL":"\u6258\u514b\u52b3","TKM":"\u571f\u5e93\u66fc\u65af\u5766","TLS":"\u4e1c\u5e1d\u6c76","TOG":"\u591a\u54e5","TPE":"\u4e2d\u56fd\u53f0\u5317","TTO":"\u7279\u7acb\u5c3c\u8fbe & \u591a\u5df4\u54e5","TUN":"\u7a81\u5c3c\u65af","TUR":"\u571f\u8033\u5176","TUV":"\u56fe\u74e6\u5362","UAE":"\u963f\u8054\u914b","UGA":"\u4e4c\u5e72\u8fbe","UKR":"\u4e4c\u514b\u5170","UMI":"\u7f8e\u56fd\u672c\u571f\u5916\u5c0f\u5c9b\u5c7f","URS":"\u82cf\u8054","URU":"\u4e4c\u62c9\u572d","USA":"\u7f8e\u56fd","UZB":"\u4e4c\u5179\u522b\u514b\u65af\u5766","VAN":"\u74e6\u52aa\u963f\u56fe","VAT":"\u68b5\u8482\u5188\u57ce\u56fd","VEN":"\u59d4\u5185\u745e\u62c9","VIE":"\u8d8a\u5357","VIN":"\u5723\u6587\u68ee\u7279\u548c\u683c\u6797\u7eb3\u4e01\u65af","WLF":"\u74e6\u5229\u65af\u548c\u5bcc\u56fe\u7eb3\u7fa4\u5c9b","XXA":"\u65e0\u56fd\u7c4d","XXB":"\u96be\u6c11","YEM":"\u4e5f\u95e8","YUG":"\u5357\u65af\u62c9\u592b","ZAM":"\u8d5e\u6bd4\u4e9a","ZIM":"\u6d25\u5df4\u5e03\u97e6"}}}

比赛项目请求:

{"result":{"status":{"code":0,"msg":"olympic discipline"},"timestamp":"Thu Aug 05 10:56:27 +0800 2021","data":{"SHO":"\u5c04\u51fb","ARC":"\u5c04\u7bad","FBL":"\u8db3\u7403","BKB":"\u7bee\u7403","BK3":"\u4e09\u5bf9\u4e09\u7bee\u7403","ATH":"\u7530\u5f84","SWM":"\u6e38\u6cf3","SWA":"\u82b1\u6837\u6e38\u6cf3","OWS":"\u9a6c\u62c9\u677e\u6e38\u6cf3","WLF":"\u4e3e\u91cd","DIV":"\u8df3\u6c34","VVO":"\u6392\u7403","VBV":"\u6c99\u6ee9\u6392\u7403","TTE":"\u4e52\u4e53\u7403","BDM":"\u7fbd\u6bdb\u7403","GTR":"\u8e66\u5e8a","GAR":"\u7ade\u6280\u4f53\u64cd","GRY":"\u827a\u672f\u4f53\u64cd","BOX":"\u62f3\u51fb","JUD":"\u67d4\u9053","WRE":"\u6454\u8de4","TKW":"\u8dc6\u62f3\u9053","KTE":"\u7a7a\u624b\u9053","HBL":"\u624b\u7403","WPO":"\u6c34\u7403","MTB":"\u5c71\u5730\u81ea\u884c\u8f66","CRD":"\u516c\u8def\u81ea\u884c\u8f66","CTR":"\u573a\u5730\u81ea\u884c\u8f66","BMF":"\u5c0f\u8f6e\u8f66\u81ea\u7531\u8d5b","BMX":"\u5c0f\u8f6e\u8f66\u8d8a\u91ce\u8d5b","SRF":"\u51b2\u6d6a","ROW":"\u8d5b\u8247","CSP":"\u76ae\u5212\u8247-\u9759\u6c34","CSL":"\u76ae\u5212\u8247-\u6fc0\u6d41\u56de\u65cb","SAL":"\u5e06\u8239\u5e06\u677f","EQU":"\u9a6c\u672f","TEN":"\u7f51\u7403","GLF":"\u9ad8\u5c14\u592b","TRI":"\u94c1\u4eba\u4e09\u9879","MPN":"\u73b0\u4ee3\u4e94\u9879","CLB":"\u6500\u5ca9","SKB":"\u6ed1\u677f","FEN":"\u51fb\u5251","RUG":"\u6a44\u6984\u7403","HOC":"\u66f2\u68cd\u7403","BSB":"\u68d2\u7403\u5792\u7403"}}} 

比赛日期请求:

{"result":{"status":{"code":0,"msg":"olympic day"},"timestamp":"Thu Aug 05 10:57:31 +0800 2021","data":["2021-07-21","2021-07-22","2021-07-23","2021-07-24","2021-07-25","2021-07-26","2021-07-27","2021-07-28","2021-07-29","2021-07-30","2021-07-31","2021-08-01","2021-08-02","2021-08-03","2021-08-04","2021-08-05","2021-08-06","2021-08-07","2021-08-08"]}}

奖牌榜数据请求:

{"result":{"status":{"code":0,"msg":"all succ"},"timestamp":"Thu Aug 05 10:57:46 +0800 2021","data":{"total":[{"gold":"32","silver":"22","bronze":"16","total":"70","goldMan":"11","silverMan":"10","bronzeMan":"9","totalMan":"30","goldWoman":"18","silverWoman":"9","bronzeWoman":"7","totalWoman":"34","goldMixed":"3","silverMixed":"3","bronzeMixed":"0","totalMixed":"6","country":"CHN","countryNameSSY":"\u4e2d\u56fd","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/CHN.png","olympicEventId":"1628","ischn":"1","rank":"1"},{"gold":"25","silver":"31","bronze":"23","total":"79","goldMan":"11","silverMan":"7","bronzeMan":"5","totalMan":"23","goldWoman":"14","silverWoman":"21","bronzeWoman":"16","totalWoman":"51","goldMixed":"0","silverMixed":"2","bronzeMixed":"2","totalMixed":"4","country":"USA","countryNameSSY":"\u7f8e\u56fd","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/USA.png","olympicEventId":"38","ischn":"0","rank":"2"},{"gold":"21","silver":"7","bronze":"12","total":"40","goldMan":"9","silverMan":"4","bronzeMan":"4","totalMan":"17","goldWoman":"11","silverWoman":"2","bronzeWoman":"7","totalWoman":"20","goldMixed":"1","silverMixed":"1","bronzeMixed":"1","totalMixed":"3","country":"JPN","countryNameSSY":"\u65e5\u672c","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/JPN.png","olympicEventId":"1696","ischn":"0","rank":"3"},{"gold":"15","silver":"18","bronze":"16","total":"49","goldMan":"8","silverMan":"10","bronzeMan":"7","totalMan":"25","goldWoman":"3","silverWoman":"6","bronzeWoman":"7","totalWoman":"16","goldMixed":"2","silverMixed":"1","bronzeMixed":"0","totalMixed":"3","country":"GBR","countryNameSSY":"\u82f1\u56fd","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/GBR.png","olympicEventId":"1529","ischn":"0","rank":"4"},{"gold":"15","silver":"4","bronze":"17","total":"36","goldMan":"5","silverMan":"2","bronzeMan":"7","totalMan":"14","goldWoman":"10","silverWoman":"1","bronzeWoman":"7","totalWoman":"18","goldMixed":"0","silverMixed":"0","bronzeMixed":"2","totalMixed":"2","country":"AUS","countryNameSSY":"\u6fb3\u5927\u5229\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/AUS.png","olympicEventId":"229","ischn":"0","rank":"5"},{"gold":"14","silver":"21","bronze":"18","total":"53","goldMan":"6","silverMan":"8","bronzeMan":"11","totalMan":"25","goldWoman":"7","silverWoman":"11","bronzeWoman":"6","totalWoman":"24","goldMixed":"1","silverMixed":"2","bronzeMixed":"1","totalMixed":"4","country":"ROC","countryNameSSY":"ROC","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ROC.png","olympicEventId":"1628","ischn":"0","rank":"6"},{"gold":"9","silver":"8","bronze":"16","total":"33","goldMan":"2","silverMan":"4","bronzeMan":"9","totalMan":"15","goldWoman":"4","silverWoman":"3","bronzeWoman":"5","totalWoman":"12","goldMixed":"0","silverMixed":"0","bronzeMixed":"2","totalMixed":"2","country":"GER","countryNameSSY":"\u5fb7\u56fd","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/GER.png","olympicEventId":"1585","ischn":"0","rank":"7"},{"gold":"6","silver":"10","bronze":"16","total":"32","goldMan":"4","silverMan":"7","bronzeMan":"8","totalMan":"19","goldWoman":"1","silverWoman":"3","bronzeWoman":"8","totalWoman":"12","goldMixed":"1","silverMixed":"0","bronzeMixed":"0","totalMixed":"1","country":"ITA","countryNameSSY":"\u610f\u5927\u5229","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ITA.png","olympicEventId":"1529","ischn":"0","rank":"8"},{"gold":"6","silver":"10","bronze":"9","total":"25","goldMan":"4","silverMan":"2","bronzeMan":"3","totalMan":"9","goldWoman":"1","silverWoman":"8","bronzeWoman":"4","totalWoman":"13","goldMixed":"1","silverMixed":"0","bronzeMixed":"1","totalMixed":"2","country":"FRA","countryNameSSY":"\u6cd5\u56fd","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/FRA.png","olympicEventId":"437","ischn":"0","rank":"9"},{"gold":"6","silver":"8","bronze":"9","total":"23","goldMan":"4","silverMan":"4","bronzeMan":"0","totalMan":"8","goldWoman":"2","silverWoman":"3","bronzeWoman":"8","totalWoman":"13","goldMixed":"0","silverMixed":"1","bronzeMixed":"0","totalMixed":"1","country":"NED","countryNameSSY":"\u8377\u5170","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/NED.png","olympicEventId":"266","ischn":"0","rank":"10"},{"gold":"6","silver":"4","bronze":"9","total":"19","goldMan":"3","silverMan":"1","bronzeMan":"6","totalMan":"10","goldWoman":"2","silverWoman":"3","bronzeWoman":"3","totalWoman":"8","goldMixed":"1","silverMixed":"0","bronzeMixed":"0","totalMixed":"1","country":"KOR","countryNameSSY":"\u97e9\u56fd","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/KOR.png","olympicEventId":"351","ischn":"0","rank":"11"},{"gold":"6","silver":"4","bronze":"5","total":"15","goldMan":"1","silverMan":"2","bronzeMan":"4","totalMan":"7","goldWoman":"5","silverWoman":"2","bronzeWoman":"1","totalWoman":"8","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"NZL","countryNameSSY":"\u65b0\u897f\u5170","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/NZL.png","olympicEventId":"109","ischn":"0","rank":"12"},{"gold":"5","silver":"6","bronze":"3","total":"14","goldMan":"5","silverMan":"6","bronzeMan":"2","totalMan":"13","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"HUN","countryNameSSY":"\u5308\u7259\u5229","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/HUN.png","olympicEventId":"1529","ischn":"0","rank":"13"},{"gold":"5","silver":"3","bronze":"4","total":"12","goldMan":"5","silverMan":"2","bronzeMan":"3","totalMan":"10","goldWoman":"0","silverWoman":"1","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"CUB","countryNameSSY":"\u53e4\u5df4","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/CUB.png","olympicEventId":"1500","ischn":"0","rank":"14"},{"gold":"4","silver":"4","bronze":"7","total":"15","goldMan":"1","silverMan":"0","bronzeMan":"1","totalMan":"2","goldWoman":"3","silverWoman":"4","bronzeWoman":"6","totalWoman":"13","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"CAN","countryNameSSY":"\u52a0\u62ff\u5927","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/CAN.png","olympicEventId":"38","ischn":"0","rank":"15"},{"gold":"4","silver":"3","bronze":"8","total":"15","goldMan":"1","silverMan":"1","bronzeMan":"6","totalMan":"8","goldWoman":"3","silverWoman":"2","bronzeWoman":"2","totalWoman":"7","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"BRA","countryNameSSY":"\u5df4\u897f","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/BRA.png","olympicEventId":"1586","ischn":"0","rank":"16"},{"gold":"4","silver":"3","bronze":"1","total":"8","goldMan":"3","silverMan":"2","bronzeMan":"1","totalMan":"6","goldWoman":"1","silverWoman":"1","bronzeWoman":"0","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"CZE","countryNameSSY":"\u6377\u514b","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/CZE.png","olympicEventId":"655","ischn":"0","rank":"17"},{"gold":"3","silver":"4","bronze":"5","total":"12","goldMan":"0","silverMan":"1","bronzeMan":"2","totalMan":"3","goldWoman":"3","silverWoman":"3","bronzeWoman":"3","totalWoman":"9","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"SUI","countryNameSSY":"\u745e\u58eb","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SUI.png","olympicEventId":"655","ischn":"0","rank":"18"},{"gold":"3","silver":"3","bronze":"4","total":"10","goldMan":"1","silverMan":"0","bronzeMan":"3","totalMan":"4","goldWoman":"1","silverWoman":"3","bronzeWoman":"1","totalWoman":"5","goldMixed":"1","silverMixed":"0","bronzeMixed":"0","totalMixed":"1","country":"POL","countryNameSSY":"\u6ce2\u5170","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/POL.png","olympicEventId":"69","ischn":"0","rank":"19"},{"gold":"3","silver":"3","bronze":"2","total":"8","goldMan":"2","silverMan":"3","bronzeMan":"2","totalMan":"7","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"CRO","countryNameSSY":"\u514b\u7f57\u5730\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/CRO.png","olympicEventId":"344","ischn":"0","rank":"20"},{"gold":"2","silver":"5","bronze":"0","total":"7","goldMan":"2","silverMan":"2","bronzeMan":"0","totalMan":"4","goldWoman":"0","silverWoman":"2","bronzeWoman":"0","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"SWE","countryNameSSY":"\u745e\u5178","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SWE.png","olympicEventId":"266","ischn":"0","rank":"21"},{"gold":"2","silver":"4","bronze":"5","total":"11","goldMan":"1","silverMan":"3","bronzeMan":"1","totalMan":"5","goldWoman":"1","silverWoman":"1","bronzeWoman":"3","totalWoman":"5","goldMixed":"0","silverMixed":"0","bronzeMixed":"1","totalMixed":"1","country":"TPE","countryNameSSY":"\u4e2d\u56fd\u53f0\u5317","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/TPE.png","olympicEventId":"1503","ischn":"0","rank":"22"},{"gold":"2","silver":"4","bronze":"1","total":"7","goldMan":"2","silverMan":"4","bronzeMan":"1","totalMan":"7","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"GEO","countryNameSSY":"\u683c\u9c81\u5409\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/GEO.png","olympicEventId":"1680","ischn":"0","rank":"23"},{"gold":"2","silver":"2","bronze":"3","total":"7","goldMan":"1","silverMan":"2","bronzeMan":"1","totalMan":"4","goldWoman":"1","silverWoman":"0","bronzeWoman":"2","totalWoman":"3","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"DEN","countryNameSSY":"\u4e39\u9ea6","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/DEN.png","olympicEventId":"229","ischn":"0","rank":"24"},{"gold":"2","silver":"2","bronze":"1","total":"5","goldMan":"2","silverMan":"2","bronzeMan":"1","totalMan":"5","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"NOR","countryNameSSY":"\u632a\u5a01","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/NOR.png","olympicEventId":"69","ischn":"0","rank":"25"},{"gold":"2","silver":"1","bronze":"2","total":"5","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"2","silverWoman":"1","bronzeWoman":"2","totalWoman":"5","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"JAM","countryNameSSY":"\u7259\u4e70\u52a0","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/JAM.png","olympicEventId":"89","ischn":"0","rank":"26"},{"gold":"2","silver":"1","bronze":"1","total":"4","goldMan":"2","silverMan":"1","bronzeMan":"1","totalMan":"4","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"IRI","countryNameSSY":"\u4f0a\u6717","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/IRI.png","olympicEventId":"1680","ischn":"0","rank":"27"},{"gold":"2","silver":"1","bronze":"1","total":"4","goldMan":"2","silverMan":"0","bronzeMan":"1","totalMan":"3","goldWoman":"0","silverWoman":"1","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"SLO","countryNameSSY":"\u65af\u6d1b\u6587\u5c3c\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SLO.png","olympicEventId":"183","ischn":"0","rank":"27"},{"gold":"2","silver":"1","bronze":"0","total":"3","goldMan":"1","silverMan":"0","bronzeMan":"0","totalMan":"1","goldWoman":"1","silverWoman":"1","bronzeWoman":"0","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"ECU","countryNameSSY":"\u5384\u74dc\u591a\u5c14","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ECU.png","olympicEventId":"1687","ischn":"0","rank":"29"},{"gold":"2","silver":"0","bronze":"1","total":"3","goldMan":"2","silverMan":"0","bronzeMan":"1","totalMan":"3","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"GRE","countryNameSSY":"\u5e0c\u814a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/GRE.png","olympicEventId":"74","ischn":"0","rank":"30"},{"gold":"2","silver":"0","bronze":"1","total":"3","goldMan":"2","silverMan":"0","bronzeMan":"1","totalMan":"3","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"UZB","countryNameSSY":"\u4e4c\u5179\u522b\u514b\u65af\u5766","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/UZB.png","olympicEventId":"1672","ischn":"0","rank":"30"},{"gold":"2","silver":"0","bronze":"0","total":"2","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"2","silverWoman":"0","bronzeWoman":"0","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"KOS","countryNameSSY":"\u79d1\u7d22\u6c83","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/KOS.png","olympicEventId":"380","ischn":"0","rank":"32"},{"gold":"2","silver":"0","bronze":"0","total":"2","goldMan":"2","silverMan":"0","bronzeMan":"0","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"QAT","countryNameSSY":"\u5361\u5854\u5c14","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/QAT.png","olympicEventId":"70","ischn":"0","rank":"32"},{"gold":"1","silver":"4","bronze":"5","total":"10","goldMan":"0","silverMan":"1","bronzeMan":"4","totalMan":"5","goldWoman":"0","silverWoman":"3","bronzeWoman":"1","totalWoman":"4","goldMixed":"1","silverMixed":"0","bronzeMixed":"0","totalMixed":"1","country":"ESP","countryNameSSY":"\u897f\u73ed\u7259","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ESP.png","olympicEventId":"427","ischn":"0","rank":"34"},{"gold":"1","silver":"3","bronze":"0","total":"4","goldMan":"0","silverMan":"2","bronzeMan":"0","totalMan":"2","goldWoman":"1","silverWoman":"1","bronzeWoman":"0","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"ROU","countryNameSSY":"\u7f57\u9a6c\u5c3c\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ROU.png","olympicEventId":"411","ischn":"0","rank":"35"},{"gold":"1","silver":"3","bronze":"0","total":"4","goldMan":"0","silverMan":"3","bronzeMan":"0","totalMan":"3","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"VEN","countryNameSSY":"\u59d4\u5185\u745e\u62c9","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/VEN.png","olympicEventId":"110","ischn":"0","rank":"35"},{"gold":"1","silver":"2","bronze":"8","total":"11","goldMan":"1","silverMan":"2","bronzeMan":"2","totalMan":"5","goldWoman":"0","silverWoman":"0","bronzeWoman":"5","totalWoman":"5","goldMixed":"0","silverMixed":"0","bronzeMixed":"1","totalMixed":"1","country":"UKR","countryNameSSY":"\u4e4c\u514b\u5170","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/UKR.png","olympicEventId":"1696","ischn":"0","rank":"37"},{"gold":"1","silver":"2","bronze":"2","total":"5","goldMan":"1","silverMan":"1","bronzeMan":"1","totalMan":"3","goldWoman":"0","silverWoman":"1","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"KEN","countryNameSSY":"\u80af\u5c3c\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/KEN.png","olympicEventId":"61","ischn":"0","rank":"38"},{"gold":"1","silver":"2","bronze":"0","total":"3","goldMan":"1","silverMan":"0","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"2","bronzeWoman":"0","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"HKG","countryNameSSY":"\u4e2d\u56fd\u9999\u6e2f","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/HKG.png","olympicEventId":"603","ischn":"0","rank":"39"},{"gold":"1","silver":"2","bronze":"0","total":"3","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"1","silverWoman":"2","bronzeWoman":"0","totalWoman":"3","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"RSA","countryNameSSY":"\u5357\u975e","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/RSA.png","olympicEventId":"607","ischn":"0","rank":"39"},{"gold":"1","silver":"2","bronze":"0","total":"3","goldMan":"0","silverMan":"2","bronzeMan":"0","totalMan":"2","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"SVK","countryNameSSY":"\u65af\u6d1b\u4f10\u514b","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SVK.png","olympicEventId":"1308","ischn":"0","rank":"39"},{"gold":"1","silver":"1","bronze":"4","total":"6","goldMan":"0","silverMan":"1","bronzeMan":"3","totalMan":"4","goldWoman":"1","silverWoman":"0","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"SRB","countryNameSSY":"\u585e\u5c14\u7ef4\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SRB.png","olympicEventId":"1692","ischn":"0","rank":"42"},{"gold":"1","silver":"1","bronze":"3","total":"5","goldMan":"0","silverMan":"0","bronzeMan":"2","totalMan":"2","goldWoman":"1","silverWoman":"1","bronzeWoman":"1","totalWoman":"3","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"AUT","countryNameSSY":"\u5965\u5730\u5229","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/AUT.png","olympicEventId":"66","ischn":"0","rank":"43"},{"gold":"1","silver":"1","bronze":"3","total":"5","goldMan":"0","silverMan":"1","bronzeMan":"2","totalMan":"3","goldWoman":"1","silverWoman":"0","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"INA","countryNameSSY":"\u5370\u5ea6\u5c3c\u897f\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/INA.png","olympicEventId":"112","ischn":"0","rank":"43"},{"gold":"1","silver":"1","bronze":"1","total":"3","goldMan":"0","silverMan":"1","bronzeMan":"1","totalMan":"2","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"BEL","countryNameSSY":"\u6bd4\u5229\u65f6","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/BEL.png","olympicEventId":"357","ischn":"0","rank":"45"},{"gold":"1","silver":"1","bronze":"1","total":"3","goldMan":"1","silverMan":"1","bronzeMan":"0","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"ETH","countryNameSSY":"\u57c3\u585e\u4fc4\u6bd4\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ETH.png","olympicEventId":"97","ischn":"0","rank":"45"},{"gold":"1","silver":"1","bronze":"1","total":"3","goldMan":"0","silverMan":"1","bronzeMan":"1","totalMan":"2","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"UGA","countryNameSSY":"\u4e4c\u5e72\u8fbe","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/UGA.png","olympicEventId":"92","ischn":"0","rank":"45"},{"gold":"1","silver":"1","bronze":"0","total":"2","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"1","silverWoman":"1","bronzeWoman":"0","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"PHI","countryNameSSY":"\u83f2\u5f8b\u5bbe","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/PHI.png","olympicEventId":"1504","ischn":"0","rank":"48"},{"gold":"1","silver":"1","bronze":"0","total":"2","goldMan":"1","silverMan":"1","bronzeMan":"0","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"TUN","countryNameSSY":"\u7a81\u5c3c\u65af","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/TUN.png","olympicEventId":"589","ischn":"0","rank":"48"},{"gold":"1","silver":"0","bronze":"5","total":"6","goldMan":"1","silverMan":"0","bronzeMan":"3","totalMan":"4","goldWoman":"0","silverWoman":"0","bronzeWoman":"2","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"TUR","countryNameSSY":"\u571f\u8033\u5176","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/TUR.png","olympicEventId":"346","ischn":"0","rank":"50"},{"gold":"1","silver":"0","bronze":"2","total":"3","goldMan":"1","silverMan":"0","bronzeMan":"1","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"IRL","countryNameSSY":"\u7231\u5c14\u5170","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/IRL.png","olympicEventId":"1498","ischn":"0","rank":"51"},{"gold":"1","silver":"0","bronze":"2","total":"3","goldMan":"1","silverMan":"0","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"1","totalMixed":"1","country":"ISR","countryNameSSY":"\u4ee5\u8272\u5217","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ISR.png","olympicEventId":"343","ischn":"0","rank":"51"},{"gold":"1","silver":"0","bronze":"1","total":"2","goldMan":"1","silverMan":"0","bronzeMan":"1","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"BLR","countryNameSSY":"\u767d\u4fc4\u7f57\u65af","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/BLR.png","olympicEventId":"70","ischn":"0","rank":"53"},{"gold":"1","silver":"0","bronze":"1","total":"2","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"1","silverWoman":"0","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"EST","countryNameSSY":"\u7231\u6c99\u5c3c\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/EST.png","olympicEventId":"1550","ischn":"0","rank":"53"},{"gold":"1","silver":"0","bronze":"1","total":"2","goldMan":"1","silverMan":"0","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"FIJ","countryNameSSY":"\u6590\u6d4e","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/FIJ.png","olympicEventId":"1335","ischn":"0","rank":"53"},{"gold":"1","silver":"0","bronze":"1","total":"2","goldMan":"1","silverMan":"0","bronzeMan":"1","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"LAT","countryNameSSY":"\u62c9\u8131\u7ef4\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/LAT.png","olympicEventId":"1672","ischn":"0","rank":"53"},{"gold":"1","silver":"0","bronze":"0","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"BER","countryNameSSY":"\u767e\u6155\u5927","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/BER.png","olympicEventId":"1647","ischn":"0","rank":"57"},{"gold":"1","silver":"0","bronze":"0","total":"1","goldMan":"1","silverMan":"0","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"MAR","countryNameSSY":"\u6469\u6d1b\u54e5","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/MAR.png","olympicEventId":"45","ischn":"0","rank":"57"},{"gold":"1","silver":"0","bronze":"0","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"PUR","countryNameSSY":"\u6ce2\u591a\u9ece\u5404","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/PUR.png","olympicEventId":"86","ischn":"0","rank":"57"},{"gold":"1","silver":"0","bronze":"0","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"1","silverWoman":"0","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"THA","countryNameSSY":"\u6cf0\u56fd","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/THA.png","olympicEventId":"642","ischn":"0","rank":"57"},{"gold":"0","silver":"2","bronze":"1","total":"3","goldMan":"0","silverMan":"2","bronzeMan":"1","totalMan":"3","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"ARM","countryNameSSY":"\u4e9a\u7f8e\u5c3c\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ARM.png","olympicEventId":"1672","ischn":"0","rank":"61"},{"gold":"0","silver":"2","bronze":"1","total":"3","goldMan":"0","silverMan":"1","bronzeMan":"1","totalMan":"2","goldWoman":"0","silverWoman":"1","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"COL","countryNameSSY":"\u54e5\u4f26\u6bd4\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/COL.png","olympicEventId":"870","ischn":"0","rank":"61"},{"gold":"0","silver":"2","bronze":"1","total":"3","goldMan":"0","silverMan":"1","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"1","bronzeMixed":"0","totalMixed":"1","country":"DOM","countryNameSSY":"\u591a\u7c73\u5c3c\u52a0","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/DOM.png","olympicEventId":"1687","ischn":"0","rank":"61"},{"gold":"0","silver":"2","bronze":"1","total":"3","goldMan":"0","silverMan":"1","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"1","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"KGZ","countryNameSSY":"\u5409\u5c14\u5409\u65af\u65af\u5766","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/KGZ.png","olympicEventId":"1696","ischn":"0","rank":"61"},{"gold":"0","silver":"1","bronze":"2","total":"3","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"1","bronzeWoman":"2","totalWoman":"3","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"IND","countryNameSSY":"\u5370\u5ea6","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/IND.png","olympicEventId":"1506","ischn":"0","rank":"65"},{"gold":"0","silver":"1","bronze":"2","total":"3","goldMan":"0","silverMan":"1","bronzeMan":"1","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"MGL","countryNameSSY":"\u8499\u53e4","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/MGL.png","olympicEventId":"374","ischn":"0","rank":"65"},{"gold":"0","silver":"1","bronze":"2","total":"3","goldMan":"0","silverMan":"0","bronzeMan":"2","totalMan":"2","goldWoman":"0","silverWoman":"1","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"POR","countryNameSSY":"\u8461\u8404\u7259","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/POR.png","olympicEventId":"110","ischn":"0","rank":"65"},{"gold":"0","silver":"1","bronze":"1","total":"2","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"1","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"BUL","countryNameSSY":"\u4fdd\u52a0\u5229\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/BUL.png","olympicEventId":"1696","ischn":"0","rank":"68"},{"gold":"0","silver":"1","bronze":"1","total":"2","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"1","bronzeWoman":"1","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"NGR","countryNameSSY":"\u5c3c\u65e5\u5229\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/NGR.png","olympicEventId":"1697","ischn":"0","rank":"68"},{"gold":"0","silver":"1","bronze":"1","total":"2","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"1","bronzeMixed":"0","totalMixed":"1","country":"SMR","countryNameSSY":"\u5723\u9a6c\u529b\u8bfa","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SMR.png","olympicEventId":"1614","ischn":"0","rank":"68"},{"gold":"0","silver":"1","bronze":"0","total":"1","goldMan":"0","silverMan":"1","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"JOR","countryNameSSY":"\u7ea6\u65e6","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/JOR.png","olympicEventId":"636","ischn":"0","rank":"71"},{"gold":"0","silver":"1","bronze":"0","total":"1","goldMan":"0","silverMan":"1","bronzeMan":"0","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"MKD","countryNameSSY":"\u5317\u9a6c\u5176\u987f","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/MKD.png","olympicEventId":"633","ischn":"0","rank":"71"},{"gold":"0","silver":"1","bronze":"0","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"1","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"NAM","countryNameSSY":"\u7eb3\u7c73\u6bd4\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/NAM.png","olympicEventId":"89","ischn":"0","rank":"71"},{"gold":"0","silver":"1","bronze":"0","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"1","bronzeWoman":"0","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"TKM","countryNameSSY":"\u571f\u5e93\u66fc\u65af\u5766","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/TKM.png","olympicEventId":"1684","ischn":"0","rank":"71"},{"gold":"0","silver":"0","bronze":"4","total":"4","goldMan":"0","silverMan":"0","bronzeMan":"3","totalMan":"3","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"KAZ","countryNameSSY":"\u54c8\u8428\u514b\u65af\u5766","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/KAZ.png","olympicEventId":"131","ischn":"0","rank":"75"},{"gold":"0","silver":"0","bronze":"3","total":"3","goldMan":"0","silverMan":"0","bronzeMan":"2","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"AZE","countryNameSSY":"\u963f\u585e\u62dc\u7586","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/AZE.png","olympicEventId":"1500","ischn":"0","rank":"76"},{"gold":"0","silver":"0","bronze":"3","total":"3","goldMan":"0","silverMan":"0","bronzeMan":"2","totalMan":"2","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"EGY","countryNameSSY":"\u57c3\u53ca","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/EGY.png","olympicEventId":"1690","ischn":"0","rank":"76"},{"gold":"0","silver":"0","bronze":"3","total":"3","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"0","bronzeWoman":"2","totalWoman":"2","goldMixed":"0","silverMixed":"0","bronzeMixed":"1","totalMixed":"1","country":"MEX","countryNameSSY":"\u58a8\u897f\u54e5","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/MEX.png","olympicEventId":"1686","ischn":"0","rank":"76"},{"gold":"0","silver":"0","bronze":"1","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"1","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"ARG","countryNameSSY":"\u963f\u6839\u5ef7","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ARG.png","olympicEventId":"426","ischn":"0","rank":"79"},{"gold":"0","silver":"0","bronze":"1","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"0","totalMan":"0","goldWoman":"0","silverWoman":"0","bronzeWoman":"1","totalWoman":"1","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"CIV","countryNameSSY":"\u79d1\u7279\u8fea\u74e6","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/CIV.png","olympicEventId":"644","ischn":"0","rank":"79"},{"gold":"0","silver":"0","bronze":"1","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"1","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"FIN","countryNameSSY":"\u82ac\u5170","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/FIN.png","olympicEventId":"576","ischn":"0","rank":"79"},{"gold":"0","silver":"0","bronze":"1","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"1","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"GHA","countryNameSSY":"\u52a0\u7eb3","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/GHA.png","olympicEventId":"1496","ischn":"0","rank":"79"},{"gold":"0","silver":"0","bronze":"1","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"1","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"KUW","countryNameSSY":"\u79d1\u5a01\u7279","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/KUW.png","olympicEventId":"537","ischn":"0","rank":"79"},{"gold":"0","silver":"0","bronze":"1","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"1","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"MAS","countryNameSSY":"\u9a6c\u6765\u897f\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/MAS.png","olympicEventId":"111","ischn":"0","rank":"79"},{"gold":"0","silver":"0","bronze":"1","total":"1","goldMan":"0","silverMan":"0","bronzeMan":"1","totalMan":"1","goldWoman":"0","silverWoman":"0","bronzeWoman":"0","totalWoman":"0","goldMixed":"0","silverMixed":"0","bronzeMixed":"0","totalMixed":"0","country":"SYR","countryNameSSY":"\u53d9\u5229\u4e9a","countryFlagSSY":"https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SYR.png","olympicEventId":"1680","ischn":"0","rank":"79"}],"sum":{"gold":"245","silver":"243","bronze":"290","total":"778","goldMan":"117","silverMan":"115","bronzeMan":"141","totalMan":"373","goldWoman":"111","silverWoman":"111","bronzeWoman":"131","totalWoman":"353","goldMixed":"12","silverMixed":"12","bronzeMixed":"13","totalMixed":"37"}}}} 

通过对返回结果的分析,可以看到都是返回的JSON结构的数据。其中奖牌榜的数据如下:

{ "result": {"status": {"code": 0,"msg": "all succ"},"timestamp": "Sat Jul 24 10:18:10 +0800 2021","data": {"total": [{"gold": "1","silver": "0","bronze": "0","total": "1","goldMan": "0","silverMan": "0","bronzeMan": "0","totalMan": "0","goldWoman": "1","silverWoman": "0","bronzeWoman": "0","totalWoman": "1","goldMixed": "0","silverMixed": "0","bronzeMixed": "0","totalMixed": "0","country": "CHN","countryNameSSY": "\u4e2d\u56fd","countryFlagSSY": "https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/CHN.png","olympicEventId": "540","ischn": "1","rank": "1"}, {"gold": "0","silver": "1","bronze": "0","total": "1","goldMan": "0","silverMan": "0","bronzeMan": "0","totalMan": "0","goldWoman": "0","silverWoman": "1","bronzeWoman": "0","totalWoman": "1","goldMixed": "0","silverMixed": "0","bronzeMixed": "0","totalMixed": "0","country": "ROC","countryNameSSY": "ROC","countryFlagSSY": "https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/ROC.png","olympicEventId": "540","ischn": "0","rank": "2"}, {"gold": "0","silver": "0","bronze": "1","total": "1","goldMan": "0","silverMan": "0","bronzeMan": "0","totalMan": "0","goldWoman": "0","silverWoman": "0","bronzeWoman": "1","totalWoman": "1","goldMixed": "0","silverMixed": "0","bronzeMixed": "0","totalMixed": "0","country": "SUI","countryNameSSY": "\u745e\u58eb","countryFlagSSY": "https:\/\/www.sinaimg.cn\/ty\/2020\/Olympic\/flag\/SUI.png","olympicEventId": "540","ischn": "0","rank": "3"}],"sum": {"gold": "1","silver": "1","bronze": "1","total": "3","goldMan": "0","silverMan": "0","bronzeMan": "0","totalMan": "0","goldWoman": "1","silverWoman": "1","bronzeWoman": "1","totalWoman": "3","goldMixed": "0","silverMixed": "0","bronzeMixed": "0","totalMixed": "0"}}}}

这个JSON中根据英文含义,可以明确知道每个字段的含义。

接下来,我们采用SpringBoot+Jsoup+fastjson来进行相关操作。

首先新建个Java实体类:

/*** 新浪奥运奖牌实体* @date 2021-07-24*/public class MedalEntity implements Serializable {private static final long serialVersionUID = 1L;/*** 国家编码*/private String country;/*** 国家名称*/private String countryNameSSY;/*** 奥运ID*/private String olympicEventId;/*** 当前排名*/private String rank;/*** 金牌*/private String gold;/*** 银牌*/private String silver;/*** 铜牌*/private String bronze;/*** 奖牌总数*/private String total;/*** 男子金牌*/private String goldMan;/*** 男子银牌*/private String silverMan;/*** 男子铜牌*/private String bronzeMan;/*** 男子奖牌总数*/private String totalMan;/*** 女子金牌*/private String goldWoman;/*** 女子银牌*/private String silverWoman;/*** 女子铜牌*/private String bronzeWoman;/*** 女子奖牌总数*/private String totalWoman;/*** 混合金牌*/private String goldMixed;/*** 混合银牌*/private String silverMixed;/*** 混合铜牌*/private String bronzeMixed;/*** 混合奖牌总数*/private String totalMixed;//此处省略setter/getter

然后写一个新浪奥运网络爬虫工具类:

package com.wxbz.olympic.util;import com.alibaba.fastjson.JSON;import com.alibaba.fastjson.JSONArray;import com.alibaba.fastjson.JSONObject;import com.alibaba.fastjson.parser.Feature;import com.wxbz.olympic.entity.MedalEntity;import org.jsoup.Jsoup;import java.io.IOException;import java.security.SecureRandom;import java.util.ArrayList;import java.util.HashMap;import java.util.List;import java.util.Map;import java.util.Random;/*** 新浪2020东京奥运请求处理类* @date 2021-07-24*/public class SinaRequestUtil {/*** 获得国家的列表,返回的国家JSON具有顺序性*/public static final String COUNTRY_URL = "http://match.2020.sina.com.cn/pc/api/schedule/country?ak=h4a7ot1i";/*** 奥运比赛项目大类*/public static final String ITEM_URL = "http://match.2020.sina.com.cn/pc/api/schedule/discipline?ak=h4a7ot1i";/*** 奥运比赛日期列表*/public static final String DATE_URL = "http://match.2020.sina.com.cn/pc/api/schedule/day?ak=h4a7ot1i";/*** 奥运所有奖牌榜数据*/public static final String MEDAL_URL = "http://match.2020.sina.com.cn/pc/api/medal/all?ak=h4a7ot1i";/*** user-agent模拟数据*/protected static final String USER_AGENT = new String {"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET CLR 2.0.50727; Media Center PC 6.0)","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.20 (KHTML, like Gecko) Chrome/19.0.1036.7 Safari/535.20","Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/73.0.3683.103"};/*** 随机获得一个User-Agent* @return*/public static String getRandomUserAgent {Random r = new SecureRandom;return USER_AGENT[r.nextInt(5)];}/*** 创建基础的Map数据* @param key* @param dataMap* @return*/public static Map<String,Object> createCodeMap(String key,JSONObject dataMap){Map<String,Object> tempMap = new HashMap<String,Object>;tempMap.put("code",key);tempMap.put("name",dataMap.getString(key));return tempMap;}/*** 查询基础的数据* @param url* @return* @throws Exception*/public static List<Map<String,Object>> getCodeDataList(String url)throws Exception{List<Map<String,Object>> countryList = new ArrayList<Map<String,Object>>;String countryData = Jsoup.connect(url).ignoreContentType(true).userAgent(getRandomUserAgent).execute.body;JSONObject countryDataObj = JSONObject.parseObject(countryData, Feature.OrderedField);int successCode = countryDataObj.getJSONObject("result").getJSONObject("status").getInteger("code");if(successCode == 0){JSONObject countryMap = countryDataObj.getJSONObject("result").getJSONObject("data");for(String key : countryMap.keySet){countryList.add(createCodeMap(key,countryMap));}}return countryList;}/*** 获得国家的配置数据* @return* @throws Exception*/public static List<Map<String,Object>> getCountryListthrows Exception{return getCodeDataList(COUNTRY_URL);}/*** 获得比赛项目的配置数据* @return* @throws Exception*/public static List<Map<String,Object>> getItemListthrows Exception{return getCodeDataList(ITEM_URL);}/*** 获得奖牌榜数据* @return* @throws Exception*/public static List<MedalEntity> getMedalDataListthrows Exception{List<MedalEntity> medalList = new ArrayList<MedalEntity>;String medalData = Jsoup.connect(MEDAL_URL).ignoreContentType(true).userAgent(getRandomUserAgent).execute.body;JSONObject medalDataObj = JSONObject.parseObject(medalData, Feature.OrderedField);int successCode = medalDataObj.getJSONObject("result").getJSONObject("status").getInteger("code");if(successCode == 0){JSONObject dataObj = medalDataObj.getJSONObject("result").getJSONObject("data");JSONArray totalArray = dataObj.getJSONArray("total");//每个国家的数据medalList = totalArray.toJavaList(MedalEntity.class);}return medalList;}public static void main(String args) throws Exception {//查询国家数据System.out.println(JSON.toJSONString(getCountryList));//查询比赛项目数据System.out.println(JSON.toJSONString(getItemList));//查询奖牌榜数据System.out.println(JSON.toJSONString(getMedalDataList));}}

执行程序后,即可以在控制台打印出我们需要的数据:

本篇文件简单介绍了如何获取奥运会奖牌的数据,后续会继续更新此系列内容,目前大概的想法有:

1、将爬虫的奖牌榜数据存储到数据库中。

2、集成Vue前端页面,展示数据并进行可视化。

3、集成定时任务进行实时数据获取处理。

感兴趣和喜欢的点个赞吧,你们的关注就是我持续的动力,期待中国获得更多金牌!

预告:别再乱花冤枉钱! Java从菜鸟到架构师自学精通!

预告: java小白如何自学?

这篇关于Java如何爬虫奥运奖牌榜数据,恭喜中国获得东京奥运会首金!的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!