首页 > 作文

玫红色壁纸

更新时间:2023-03-09 13:30:57 阅读: 评论:0

花的用途-男士如何穿衣打扮

玫红色壁纸
2023年3月9日发(作者:张丽莉)

python爬取王者荣耀全套⽪肤壁纸

1.获取英雄列表

可以看到所有英雄都在

⾥⾯的内容是这样的

[{

"ename":105,

"cname":"廉颇",

"title":"正义爆轰",

"new_type":0,

"hero_type":3,

"skin_name":"正义爆轰|地狱岩魂"

},{

"ename":106,

"cname":"⼩乔",

"title":"恋之微风",

"pay_type":10,

"new_type":0,

"hero_type":2,

"skin_name":"恋之微风|万圣前夜|天鹅之梦|纯⽩花嫁|缤纷独⾓兽"

},{

"ename":107,

"cname":"赵云",

"title":"苍天翔龙",

"pay_type":10,

"new_type":0,

"hero_type":1,

"hero_type2":4,

"skin_name":"苍天翔龙|忍●炎影|未来纪元|皇家上将|嘻哈天王|⽩执事|引擎之⼼"

},{

"ename":108,

"cname":"墨⼦",

"title":"和平守望",

"new_type":0,

"hero_type":2,

"hero_type2":1,

"skin_name":"和平守望|⾦属风暴|龙骑⼠|进击墨⼦号"

},{

"ename":109,

"cname":"妲⼰",

"title":"魅⼒之狐",

"pay_type":11,

"new_type":0,

"hero_type":2,

"skin_name":"魅惑之狐|⼥仆咖啡|魅⼒维加斯|仙境爱丽丝|少⼥阿狸|热情桑巴"

},{

"ename":110,

"cname":"嬴政",

"title":"王者独尊",

"new_type":0,

"hero_type":2,

"skin_name":"王者独尊|摇滚巨星|暗夜贵公⼦|优雅恋⼈|⽩昼王⼦"

},{

"ename":111,

"cname":"孙尚⾹",

"title":"千⾦重弩",

"new_type":0,

"hero_type":5,

"skin_name":"千⾦重弩|⽕炮千⾦|⽔果甜⼼|蔷薇恋⼈|杀⼿不太冷|末⽇机甲|沉稳之⼒"

},{

"ename":112,

"cname":"鲁班七号",

"title":"机关造物",

"new_type":0,

"hero_type":5,

"skin_name":"机关造物|⽊偶奇遇记|福禄兄弟|电玩⼩⼦|星空梦想"

},{

"ename":113,

"cname":"庄周",

"title":"逍遥梦幻",

"new_type":0,

"hero_type":6,

"hero_type2":3,

"skin_name":"逍遥幻梦|鲤鱼之梦|蜃楼王|云端筑梦师"

},{

"ename":114,

"cname":"刘禅",

"title":"暴⾛机关",

"new_type":0,

"hero_type":6,

"hero_type2":3,

"skin_name":"暴⾛机关|英喵野望|绅⼠熊喵|天才门将"

},{

"ename":115,

"cname":"⾼渐离",

"title":"叛逆吟游",

"new_type":0,

"hero_type":2,

"skin_name":"叛逆吟游|⾦属狂潮|死亡摇滚"

},{

"ename":116,

"cname":"阿轲",

"title":"信念之刃",

"new_type":0,

"hero_type":4,

"skin_name":"信念之刃|爱⼼护理|暗夜猫娘|致命风华|节奏热浪"

},{

"ename":117,

"cname":"钟⽆艳",

"title":"野蛮之锤",

"new_type":0,

"hero_type":1,

"hero_type2":3,

"skin_name":"野蛮之锤|⽣化警戒|王者之锤|海滩丽影"

},{

"ename":118,

"cname":"孙膑",

"title":"逆流之时",

"new_type":0,

"hero_type":6,

"hero_type2":2,

"skin_name":"逆流之时|未来旅⾏|天使之翼|妖精王"

},{

"ename":119,

"cname":"扁鹊",

"title":"善恶怪医",

"new_type":0,

"hero_type":2,

"skin_name":"善恶怪医|救世之瞳|化⾝博⼠|炼⾦王"

},{

"ename":120,

"cname":"⽩起",

"title":"最终兵器",

"new_type":0,

"hero_type":3,

"skin_name":"最终兵器|⽩⾊死神|狰|星夜王⼦"

},{

"ename":121,

"cname":"芈⽉",

"title":"永恒之⽉",

"new_type":0,

"hero_type":2,

"hero_type2":3,

"skin_name":"永恒之⽉|红桃皇后|⼤秦宣太后|重明"

},{

"ename":123,

"cname":"吕布",

"title":"⽆双之魔",

"new_type":0,

"hero_type":1,

"hero_type2":3,

"skin_name":"⽆双之魔|圣诞狂欢|天魔缭乱|末⽇机甲|猎兽之王"

},{

"ename":124,

"cname":"周瑜",

"title":"铁⾎都督",

"new_type":0,

"hero_type":2,

"skin_name":"铁⾎都督|海军⼤将|真爱⾄上"

},{

"ename":126,

"cname":"夏侯惇",

"title":"不羁之风",

"pay_type":10,

"new_type":0,

"hero_type":3,

"hero_type2":1,

"skin_name":"不羁之风|战争骑⼠|乘风破浪|⽆限飓风号"

},{

"ename":127,

"cname":"甄姬",

"title":"洛神降临",

"new_type":0,

"hero_type":2,

"skin_name":"洛神降临|冰雪圆舞曲|花好⼈间|游园惊梦"

},{

"ename":128,

"cname":"曹操",

"title":"鲜⾎枭雄",

"pay_type":10,

"new_type":0,

"hero_type":1,

"skin_name":"鲜⾎枭雄|超能战警|幽灵船长|死神来了|烛龙"

},{

"ename":129,

"cname":"典韦",

"title":"狂战⼠",

"new_type":0,

"hero_type":1,

"skin_name":"狂战⼠|黄⾦武⼠|穷奇"

},{

"ename":130,

"cname":"宫本武藏",

"title":"剑圣",

"new_type":0,

"hero_type":1,

"skin_name":"剑圣|⿁剑武藏|未来纪元|万象初新|地狱之眼|霸王丸"

},{

"ename":131,

"cname":"李⽩",

"title":"青莲剑仙",

"new_type":0,

"hero_type":4,

"skin_name":"青莲剑仙|范海⾟|千年之狐|凤求凰|敏锐之⼒"

},{

"ename":132,

"cname":"马可波罗",

"title":"远游之枪",

"pay_type":10,

"new_type":0,

"hero_type":5,

"skin_name":"远游之枪|激情绿茵|逐梦之星"

},{

"ename":133,

"cname":"狄仁杰",

"title":"断案⼤师",

"pay_type":11,

"new_type":0,

"hero_type":5,

"skin_name":"断案⼤师|锦⾐卫|魔术师|超时空战⼠|阴阳师"

},{

"ename":134,

"cname":"达摩",

"title":"拳僧",

"new_type":0,

"hero_type":1,

"hero_type2":3,

"skin_name":"拳僧|⼤发明家|拳王"

},{

"ename":135,

"cname":"项⽻",

"title":"霸王",

"new_type":0,

"hero_type":3,

"skin_name":"霸王|帝国元帅|苍穹之光|海滩派对|职棒王牌|霸王别姬|科学⼤爆炸"

},{

"ename":136,

"cname":"武则天",

"title":"⼥帝",

"new_type":0,

"hero_type":2,

"skin_name":"⼥帝|东⽅不败|海洋之⼼"

},{

"ename":139,

"cname":"⽼夫⼦",

"title":"万古长明",

"new_type":0,

"hero_type":1,

"skin_name":"万古长明|潮流仙⼈|圣诞⽼⼈|功夫⽼勺"

},{

"ename":140,

"cname":"关⽻",

"title":"⼀骑当千",

"new_type":0,

"hero_type":1,

"skin_name":"⼀骑当千|天启骑⼠|冰锋战神|龙腾万⾥"

},{

"ename":141,

"cname":"貂蝉",

"title":"绝世舞姬",

"new_type":0,

"hero_type":2,

"hero_type2":4,

"skin_name":"绝世舞姬|异域舞娘|圣诞恋歌|逐梦之⾳|仲夏夜之梦"

},{

"ename":142,

"cname":"安琪拉",

"title":"暗夜萝莉",

"new_type":0,

"hero_type":2,

"skin_name":"暗夜萝莉|玩偶对对碰|魔法⼩厨娘|⼼灵骇客|如懿"

},{

"ename":144,

"cname":"程咬⾦",

"title":"热烈之斧",

"new_type":0,

"hero_type":3,

"hero_type2":1,

"skin_name":"热烈之斧|爱与正义|星际陆战队|华尔街⼤亨|功夫厨神"

},{

"ename":146,

"cname":"露娜",

"title":"⽉光之⼥",

"new_type":0,

"hero_type":1,

"hero_type2":2,

"skin_name":"⽉光之⼥|哥特玫瑰|绯红之刃|紫霞仙⼦|⼀⽣所爱"

},{

"ename":148,

"cname":"姜⼦⽛",

"title":"太古魔导",

"new_type":0,

"hero_type":2,

"skin_name":"太古魔导|时尚教⽗"

},{

"ename":149,

"cname":"刘邦",

"title":"双⾯君主",

"new_type":0,

"hero_type":3,

"skin_name":"双⾯君主|圣殿之光|德古拉伯爵"

},{

"ename":150,

"cname":"韩信",

"title":"国⼠⽆双",

"new_type":0,

"hero_type":4,

"skin_name":"国⼠⽆双|街头霸王|教廷特使|⽩龙吟|逐梦之影"

},{

"ename":152,

"cname":"王昭君",

"title":"冰雪之华",

"new_type":0,

"hero_type":2,

"skin_name":"冰雪之华|精灵公主|偶像歌⼿|凤凰于飞|幻想奇妙夜"

},{

"ename":153,

"cname":"兰陵王",

"title":"暗影⼑锋",

"new_type":0,

"hero_type":4,

"skin_name":"暗影⼑锋|隐刃|暗隐猎兽者"

},{

"ename":154,

"cname":"花⽊兰",

"title":"传说之刃",

"new_type":0,

"hero_type":1,

"hero_type2":4,

"skin_name":"传说之刃|剑舞者|兔⼥郎|⽔晶猎龙者|青春决赛季|冠军飞将|瑞麟志"

},{

"ename":156,

"cname":"张良",

"title":"⾔灵之书",

"new_type":0,

"hero_type":2,

"skin_name":"⾔灵之书|天堂福⾳|⼀千零⼀夜|幽兰居⼠"

},{

"ename":157,

"cname":"不知⽕舞",

"title":"明媚烈焰",

"new_type":0,

"hero_type":2,

"hero_type2":4,

"skin_name":"明媚烈焰"

},{

"ename":162,

"cname":"娜可露露",

"title":"鹰之守护",

"new_type":0,

"hero_type":4,

"skin_name":"鹰之守护"

},{

"ename":163,

"cname":"橘右京",

"title":"神梦⼀⼑",

"new_type":0,

"hero_type":4,

"hero_type2":1,

"skin_name":"神梦⼀⼑"

},{

"ename":166,

"cname":"亚瑟",

"title":"圣骑之⼒",

"pay_type":11,

"new_type":0,

"hero_type":1,

"hero_type2":3,

"skin_name":"圣骑之⼒|死亡骑⼠|狮⼼王|⼼灵战警"

},{

"ename":167,

"cname":"孙悟空",

"title":"齐天⼤圣",

"new_type":0,

"hero_type":4,

"hero_type2":1,

"skin_name":"齐天⼤圣|地狱⽕|西部⼤镖客|美猴王|⾄尊宝|全息碎影|⼤圣娶亲"

},{

"ename":168,

"cname":"⽜魔",

"title":"精英酋长",

"new_type":0,

"hero_type":6,

"hero_type2":3,

"skin_name":"精英酋长|西部⼤镖客|制霸全明星"

},{

"ename":169,

"cname":"后羿",

"title":"半神之⼸",

"new_type":0,

"hero_type":5,

"skin_name":"半神之⼸|精灵王|阿尔法⼩队|辉光之⾠|黄⾦射⼿座"

},{

"ename":170,

"cname":"刘备",

"title":"仁德义枪",

"new_type":0,

"hero_type":1,

"skin_name":"仁德义枪|万事如意|纽约教⽗|汉昭烈帝"

},{

"ename":171,

"cname":"张飞",

"title":"禁⾎狂兽",

"pay_type":10,

"new_type":0,

"hero_type":3,

"hero_type2":6,

"skin_name":"禁⾎狂兽|五福同⼼|乱世虎⾂"

},{

"ename":173,

"cname":"李元芳",

"title":"王都密探",

"new_type":0,

"hero_type":5,

"skin_name":"王都密探|特种部队|⿊猫爱糖果|逐浪之夏"

},{

"ename":174,

"cname":"虞姬",

"title":"森之风灵",

"new_type":0,

"hero_type":5,

"skin_name":"森之风灵|加勒⽐⼩姐|霸王别姬|凯尔特⼥王"

},{

"ename":175,

"cname":"钟馗",

"title":"虚灵城判",

"pay_type":10,

"new_type":0,

"hero_type":6,

"hero_type2":2,

"skin_name":"虚灵城判|地府判官"

},{

"ename":177,

"cname":"成吉思汗",

"title":"苍狼末裔",

"new_type":0,

"hero_type":5,

"skin_name":"苍狼末裔|维京掠夺者"

},{

"ename":178,

"cname":"杨戬",

"title":"根源之⽬",

"new_type":0,

"hero_type":1,

"skin_name":"根源之⽬|埃及法⽼|永曜之星"

},{

"ename":183,

"cname":"雅典娜",

"title":"圣域余晖",

"new_type":0,

"hero_type":1,

"skin_name":"圣域余晖|战争⼥神|冰冠公主|神奇⼥侠"

},{

"ename":184,

"cname":"蔡⽂姬",

"title":"天籁弦⾳",

"new_type":0,

"hero_type":6,

"skin_name":"天籁弦⾳|蔷薇王座|舞动绿茵|奇迹圣诞"

},{

"ename":186,

"cname":"太⼄真⼈",

"title":"炼⾦⼤师",

"new_type":0,

"hero_type":6,

"hero_type2":3,

"skin_name":"炼⾦⼤师|圆桌骑⼠|饕餮|华丽摇滚"

},{

"ename":180,

"cname":"哪吒",

"title":"桀骜炎枪",

"new_type":0,

"hero_type":1,

"skin_name":"桀骜炎枪|三太⼦|逐梦之翼"

},{

"ename":190,

"cname":"诸葛亮",

"title":"绝代智谋",

"new_type":0,

"hero_type":2,

"skin_name":"绝代智谋|星航指挥官|黄⾦分割率|武陵仙君|掌控之⼒"

},{

"ename":192,

"cname":"黄忠",

"title":"燃魂重炮",

"new_type":0,

"hero_type":5,

"skin_name":"燃魂重炮|芝加哥教⽗"

},{

"ename":191,

"cname":"⼤乔",

"title":"沧海之曜",

"new_type":0,

"hero_type":6,

"skin_name":"沧海之曜|伊势巫⼥|守护之⼒|猫狗⽇记"

},{

"ename":187,

"cname":"东皇太⼀",

"title":"噬灭⽇蚀",

"new_type":0,

"hero_type":6,

"hero_type2":3,

"skin_name":"噬灭⽇蚀|东海龙王|逐梦之光"

},{

"ename":182,

"cname":"⼲将莫邪",

"title":"淬命双剑",

"new_type":0,

"hero_type":2,

"skin_name":"淬命双剑|第七⼈偶|冰霜恋舞曲"

},{

"ename":189,

"cname":"⿁⾕⼦",

"title":"万物有灵",

"new_type":0,

"hero_type":6,

"skin_name":"万物有灵|阿摩司公爵|幻乐之宴"

},{

"ename":193,

"cname":"铠",

"title":"破灭刃锋",

"new_type":0,

"hero_type":1,

"hero_type2":3,

"skin_name":"破灭刃锋|龙域领主|曙光守护者|青龙志"

},{

"ename":196,

"cname":"百⾥守约",

"title":"静谧之眼",

"new_type":0,

"hero_type":5,

"hero_type2":4,

"skin_name":"静谧之眼|绝影神枪|特⼯魅影|朱雀志"

},{

"ename":195,

"cname":"百⾥⽞策",

"title":"嚣狂之镰",

"new_type":0,

"hero_type":4,

"skin_name":"嚣狂之镰|威尼斯狂欢|⽩虎志"

},{

"ename":194,

"cname":"苏烈",

"title":"不屈铁壁",

"new_type":0,

"hero_type":3,

"hero_type2":1,

"skin_name":"不屈铁壁|爱与和平|坚韧之⼒|⽞武志"

},{

"ename":198,

"cname":"梦奇",

"title":"⼊梦之灵",

"new_type":0,

"hero_type":1,

"hero_type2":3,

"skin_name":"⼊梦之灵|美梦成真|胖达荣荣"

},{

"ename":179,

"cname":"⼥娲",

"title":"⾄⾼创世",

"new_type":0,

"hero_type":2,

"skin_name":"⾄⾼创世|尼罗河⼥神"

},{

"ename":501,

"cname":"明世隐",

"title":"灵魂劫⼘",

"new_type":0,

"hero_type":6,

"skin_name":"灵魂劫⼘|占星术⼠|虹云星官"

},{

"ename":199,

"cname":"公孙离",

"title":"幻舞玲珑",

"new_type":0,

"hero_type":5,

"skin_name":"幻舞玲珑|花间舞|蜜橘之夏"

},{

"ename":176,

"cname":"杨⽟环",

"title":"霓裳风华",

"new_type":0,

"hero_type":2,

"skin_name":"风华霓裳|霓裳曲|遇见飞天"

},{

"ename":502,

"cname":"裴擒虎",

"title":"六合虎拳",

"new_type":0,

"hero_type":4,

"hero_type2":1,

"skin_name":"六合虎拳|街头霸王|梅西"

},{

"ename":197,

"cname":"弈星",

"title":"天元之弈",

"new_type":0,

"hero_type":2,

"skin_name":"天元之弈|踏雪寻梅"

},{

"ename":503,

"cname":"狂铁",

"title":"战车意志",

"new_type":0,

"hero_type":1,

"skin_name":"战车意志|命运⾓⽃场|御狮"

},{

"ename":504,

"cname":"⽶莱狄",

"title":"筑城者",

"new_type":0,

"hero_type":2,

"skin_name":"筑城者|精准探案法|御霄"

},{

"ename":125,

"cname":"元歌",

"title":"⽆间傀儡",

"new_type":0,

"hero_type":4,

"skin_name":"⽆间傀儡|午夜歌剧院"

},{

"ename":510,

"cname":"孙策",

"title":"光明之海",

"new_type":0,

"hero_type":3,

"hero_type2":1,

"skin_name":"光明之海|海之征途|猫狗⽇记"

},{

"ename":137,

"cname":"司马懿",

"title":"寂灭之⼼",

"new_type":0,

"hero_type":4,

"hero_type2":2,

"skin_name":"寂灭之⼼|魇语军师"

},{

"ename":509,

"cname":"盾⼭",

"title":"⽆尽之盾",

"new_type":0,

"hero_type":6,

"hero_type2":3,

"skin_name":"⽆尽之盾|极冰防御线"

},{

"ename":508,

"cname":"伽罗",

"title":"破魔之箭",

"new_type":0,

"hero_type":5,

"skin_name":"破魔之箭|花见巫⼥"

},{

"ename":312,

"cname":"沈梦溪",

"title":"爆弹怪猫",

"new_type":0,

"hero_type":2,

"skin_name":"爆弹怪猫|棒球奇才"

},{

"ename":507,

"cname":"李信",

"title":"谋世之战",

"new_type":0,

"hero_type":1,

"skin_name":"谋世之战|灼热之刃"

},{

"ename":513,

"cname":"上官婉⼉",

"title":"惊鸿之笔",

"new_type":0,

"hero_type":2,

"hero_type2":4,

"skin_name":"惊鸿之笔|修⽵墨客"

},{

"ename":515,

"cname":"嫦娥",

"title":"寒⽉公主",

"new_type":0,

"hero_type":2,

"hero_type2":3,

"skin_name":"寒⽉公主|露花倒影"

},{

"ename":511,

"cname":"猪⼋戒",

"title":"⽆忧猛⼠",

"new_type":0,

"hero_type":3,

"skin_name":"⽆忧猛⼠|年年有余"

},{

"ename":529,

"cname":"盘古",

"title":"破晓之神",

"new_type":0,

"hero_type":1,

"skin_name":"破晓之神"

},{

"ename":505,

"cname":"瑶",

"title":"⿅灵守⼼",

"new_type":0,

"hero_type":6,

"skin_name":"森"

},{

"ename":506,

"cname":"云中君",

"title":"流云之翼",

"new_type":0,

"hero_type":4,

"hero_type2":1,

"skin_name":"荷鲁斯之眼"

},{

"ename":522,

"cname":"曜",

"title":"星⾠之⼦",

"new_type":0,

"hero_type":1,

"skin_name":"归虚梦演"

},{

"ename":518,

"cname":"马超",

"title":"冷晖之枪",

"new_type":0,

"hero_type":1,

"hero_type2":4

},{

"ename":523,

"cname":"西施",

"title":"幻纱之灵",

"new_type":0,

"hero_type":2,

"skin_name":"幻纱之灵|归虚梦演"

},{

"ename":525,

"cname":"鲁班⼤师",

"title":"神匠",

"new_type":0,

"hero_type":6,

"skin_name":"神匠|归虚梦演"

},{

"ename":524,

"cname":"蒙犽",

"title":"烈炮⼩⼦",

"new_type":0,

"hero_type":5,

"skin_name":"烈炮⼩⼦|归虚梦演"

},{

"ename":531,

"cname":"镜",

"title":"破镜之刃",

"new_type":0,

"hero_type":4,

"skin_name":"破镜之刃|冰刃幻境"

},{

"ename":527,

"cname":"蒙恬",

"title":"秩序统将",

"new_type":0,

"hero_type":1,

"hero_type2":3,

"skin_name":"秩序统将|秩序猎龙将"

},{

"ename":533,

"cname":"阿古朵",

"title":"⼭林之⼦",

"new_type":0,

"hero_type":3,

"hero_type2":6,

"skin_name":"⼭林之⼦"

},{

"ename":536,

"cname":"夏洛特",

"title":"玫瑰剑⼠",

"new_type":0,

"hero_type":1,

"skin_name":"玫瑰剑⼠"

},{

"ename":528,

"cname":"澜",

"title":"鲨之猎刃",

"new_type":0,

"hero_type":4,

"skin_name":"鲨之猎刃"

},{

"ename":537,

"cname":"司空震",

"title":"雷霆之王",

"new_type":0,

"hero_type":1,

"hero_type2":2,

"skin_name":"雷霆之王"

},{

"ename":155,

"cname":"艾琳",

"title":"精灵之舞",

"new_type":1,

"hero_type":5,

"skin_name":"精灵之舞"}]

ViewCode

可以看出ename是英雄IDcname是英雄名称

这就很简单了可以这样写

#读取英雄列表

url='/web201605/js/'

content=(url)

hero_json=()

2.获取英雄⽪肤

查看代码定位到-pf-list为显⽰英雄⽪肤容器进⼀步看到的⼀段代码

//完整链接为/web201706/herodetail/cssjs/

varskinlist=$('.pic-pf-list'),

allname=('imgname').split('|'),

skinbg=$('.zk-con1'),

herotitle=$('.cover-title'),t=true,pf=$("."),

surl='///images/yxzj/img201606/heroimg/'+ename+'/'+ename,

burl="///images/yxzj/img201606/skin/hero-info/"+ename+'/'+ename,

shtml='',

skins=[],

nameAnd;

for(vari=0;i<;i++){

nameAnd=allname[i].split('&')

if(>1){

({

name:nameAnd[0],

icon:nameAnd[1]

})

}el{

({

name:nameAnd[0],

icon:0

})

}

}

functionwrap(a,b){

for(vari=a;i

varbskin=burl+"-bigskin-"+(i+1)+".jpg";

shtml+='

  • '+skins[i].name+'

  • };

    }

    wrap(0,);

    (shtml);

    这⾥可以看出⽪肤地址为///images/yxzj/img201606/skin/hero-info/{英雄ID}/{英雄ID}-bigskin-{⾃增ID}.jpg

    数量通过分割('imgname')属性按‘|’分割获取(看下⾯红⾊部分)

    那么代码就可以这样写了

    #读取英雄详情

    url='/web201605/herodetail/{英雄ID}.shtml

    content=(url)

    #改变编码

    ng='gb2312'

    soup=BeautifulSoup(,'lxml')

    data=(class_='pic-pf-list3')['data-imgname']

    index=0

    ('|'):

    index+=1

    imgrul='/images/yxzj/img201606/skin/hero-info/{英雄ID}/{英雄ID}-bigskin-{index}.jpg

    print(imgrul)

    下⼀步保存就可以了

    完整代码如下

    importrequests

    importjson

    importos

    frombs4importBeautifulSoup

    #读取英雄列表

    url='/web201605/js/'

    content=(url)

    ():

    ename=v['ename']

    cname=v['cname']

    #创建⽬录

    savePath=(h('./hero_img'),cname)

    (savePath):

    print('创建⽬录%s'%(savePath))

    rs(savePath)

    #读取英雄详情

    url='/web201605/herodetail/%'%(ename)

    content=(url)

    #改变编码

    ng='gb2312'

    soup=BeautifulSoup(,'lxml')

    data=(class_='pic-pf-list3')['data-imgname']

    #print(data)

    #读取记录

    index=0

    ('|'):

    index+=1

    img=('&')

    imgUrl='/images/yxzj/img201606/skin/hero-info/%d/%d-bigskin-%'%(ename,ename,index)

    imgName="%s_%"%(img[0],img[1])

    imgContent=(imgUrl)

    _code==200:

    withopen(file=(savePath,imgName),mode='wb')asf:

    (t)

    结果打印如下

    创建⽬录C:UrsAdministratorpytesthero_img⼩乔

    创建⽬录C:UrsAdministratorpytesthero_img赵云

    创建⽬录C:UrsAdministratorpytesthero_img墨⼦

    创建⽬录C:UrsAdministratorpytesthero_img妲⼰

    创建⽬录C:UrsAdministratorpytesthero_img嬴政

    创建⽬录C:UrsAdministratorpytesthero_img孙尚⾹

    创建⽬录C:UrsAdministratorpytesthero_img鲁班七号

    创建⽬录C:UrsAdministratorpytesthero_img庄周

    创建⽬录C:UrsAdministratorpytesthero_img刘禅

    创建⽬录C:UrsAdministratorpytesthero_img⾼渐离

    创建⽬录C:UrsAdministratorpytesthero_img阿轲

    创建⽬录C:UrsAdministratorpytesthero_img钟⽆艳

    创建⽬录C:UrsAdministratorpytesthero_img孙膑

    创建⽬录C:UrsAdministratorpytesthero_img扁鹊

    创建⽬录C:UrsAdministratorpytesthero_img⽩起

    创建⽬录C:UrsAdministratorpytesthero_img芈⽉

    创建⽬录C:UrsAdministratorpytesthero_img吕布

    创建⽬录C:UrsAdministratorpytesthero_img周瑜

    创建⽬录C:UrsAdministratorpytesthero_img夏侯惇

    创建⽬录C:UrsAdministratorpytesthero_img甄姬

    创建⽬录C:UrsAdministratorpytesthero_img曹操

    创建⽬录C:UrsAdministratorpytesthero_img典韦

    创建⽬录C:UrsAdministratorpytesthero_img宫本武藏

    创建⽬录C:UrsAdministratorpytesthero_img李⽩

    创建⽬录C:UrsAdministratorpytesthero_img马可波罗

    创建⽬录C:UrsAdministratorpytesthero_img狄仁杰

    创建⽬录C:UrsAdministratorpytesthero_img达摩

    创建⽬录C:UrsAdministratorpytesthero_img项⽻

    创建⽬录C:UrsAdministratorpytesthero_img武则天

    创建⽬录C:UrsAdministratorpytesthero_img⽼夫⼦

    创建⽬录C:UrsAdministratorpytesthero_img关⽻

    创建⽬录C:UrsAdministratorpytesthero_img貂蝉

    创建⽬录C:UrsAdministratorpytesthero_img安琪拉

    创建⽬录C:UrsAdministratorpytesthero_img程咬⾦

    创建⽬录C:UrsAdministratorpytesthero_img露娜

    创建⽬录C:UrsAdministratorpytesthero_img姜⼦⽛

    创建⽬录C:UrsAdministratorpytesthero_img刘邦

    创建⽬录C:UrsAdministratorpytesthero_img韩信

    创建⽬录C:UrsAdministratorpytesthero_img王昭君

    创建⽬录C:UrsAdministratorpytesthero_img兰陵王

    创建⽬录C:UrsAdministratorpytesthero_img花⽊兰

    创建⽬录C:UrsAdministratorpytesthero_img张良

    创建⽬录C:UrsAdministratorpytesthero_img不知⽕舞

    创建⽬录C:UrsAdministratorpytesthero_img娜可露露

    创建⽬录C:UrsAdministratorpytesthero_img橘右京

    创建⽬录C:UrsAdministratorpytesthero_img亚瑟

    创建⽬录C:UrsAdministratorpytesthero_img孙悟空

    创建⽬录C:UrsAdministratorpytesthero_img⽜魔

    创建⽬录C:UrsAdministratorpytesthero_img后羿

    创建⽬录C:UrsAdministratorpytesthero_img刘备

    创建⽬录C:UrsAdministratorpytesthero_img张飞

    创建⽬录C:UrsAdministratorpytesthero_img李元芳

    创建⽬录C:UrsAdministratorpytesthero_img虞姬

    创建⽬录C:UrsAdministratorpytesthero_img钟馗

    创建⽬录C:UrsAdministratorpytesthero_img成吉思汗

    创建⽬录C:UrsAdministratorpytesthero_img杨戬

    创建⽬录C:UrsAdministratorpytesthero_img雅典娜

    创建⽬录C:UrsAdministratorpytesthero_img蔡⽂姬

    创建⽬录C:UrsAdministratorpytesthero_img太⼄真⼈

    创建⽬录C:UrsAdministratorpytesthero_img哪吒

    创建⽬录C:UrsAdministratorpytesthero_img诸葛亮

    创建⽬录C:UrsAdministratorpytesthero_img黄忠

    创建⽬录C:UrsAdministratorpytesthero_img⼤乔

    创建⽬录C:UrsAdministratorpytesthero_img东皇太⼀

    创建⽬录C:UrsAdministratorpytesthero_img⼲将莫邪

    创建⽬录C:UrsAdministratorpytesthero_img⿁⾕⼦

    创建⽬录C:UrsAdministratorpytesthero_img铠

    创建⽬录C:UrsAdministratorpytesthero_img百⾥守约

    创建⽬录C:UrsAdministratorpytesthero_img百⾥⽞策

    创建⽬录C:UrsAdministratorpytesthero_img苏烈

    创建⽬录C:UrsAdministratorpytesthero_img梦奇

    创建⽬录C:UrsAdministratorpytesthero_img⼥娲

    创建⽬录C:UrsAdministratorpytesthero_img明世隐

    创建⽬录C:UrsAdministratorpytesthero_img公孙离

    创建⽬录C:UrsAdministratorpytesthero_img杨⽟环

    创建⽬录C:UrsAdministratorpytesthero_img裴擒虎

    创建⽬录C:UrsAdministratorpytesthero_img弈星

    创建⽬录C:UrsAdministratorpytesthero_img狂铁

    创建⽬录C:UrsAdministratorpytesthero_img⽶莱狄

    创建⽬录C:UrsAdministratorpytesthero_img元歌

    创建⽬录C:UrsAdministratorpytesthero_img孙策

    创建⽬录C:UrsAdministratorpytesthero_img司马懿

    创建⽬录C:UrsAdministratorpytesthero_img盾⼭

    创建⽬录C:UrsAdministratorpytesthero_img伽罗

    创建⽬录C:UrsAdministratorpytesthero_img沈梦溪

    创建⽬录C:UrsAdministratorpytesthero_img李信

    创建⽬录C:UrsAdministratorpytesthero_img上官婉⼉

    创建⽬录C:UrsAdministratorpytesthero_img嫦娥

    创建⽬录C:UrsAdministratorpytesthero_img猪⼋戒

    创建⽬录C:UrsAdministratorpytesthero_img盘古

    创建⽬录C:UrsAdministratorpytesthero_img瑶

    创建⽬录C:UrsAdministratorpytesthero_img云中君

    创建⽬录C:UrsAdministratorpytesthero_img曜

    创建⽬录C:UrsAdministratorpytesthero_img马超

    创建⽬录C:UrsAdministratorpytesthero_img西施

    创建⽬录C:UrsAdministratorpytesthero_img鲁班⼤师

    创建⽬录C:UrsAdministratorpytesthero_img蒙犽

    创建⽬录C:UrsAdministratorpytesthero_img镜

    创建⽬录C:UrsAdministratorpytesthero_img蒙恬

    创建⽬录C:UrsAdministratorpytesthero_img阿古朵

    创建⽬录C:UrsAdministratorpytesthero_img夏洛特

    创建⽬录C:UrsAdministratorpytesthero_img澜

    创建⽬录C:UrsAdministratorpytesthero_img司空震

    创建⽬录C:UrsAdministratorpytesthero_img艾琳

    本文发布于:2023-03-09 13:30:56,感谢您对本站的认可!

    本文链接:https://www.wtabcd.cn/fanwen/zuowen/1678339857194116.html

    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

    本文word下载地址:玫红色壁纸.doc

    本文 PDF 下载地址:玫红色壁纸.pdf

    标签:玫红色壁纸
    相关文章
    留言与评论(共有 0 条评论)
       
    验证码:
    推荐文章
    排行榜
    Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图