欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

【python】【爬虫】爬取Fate Grand Order wiki所有英灵礼装图鉴

发布时间:2024/1/8 57 豆豆
生活随笔 收集整理的这篇文章主要介绍了 【python】【爬虫】爬取Fate Grand Order wiki所有英灵礼装图鉴 小编觉得挺不错的,现在分享给大家,帮大家做个参考.
import requests from lxml import etreefor i in range(1,895):''' url0="https://fgowiki.com/guide/equipdetail/894?p=pc" #网页地址res=requests.get(url0)content=res.contenthtml=etree.HTML(content)name=html.xpath('//*[@id="row-move"]/div[2]/div/div[2]/div/div/table[1]/tbody/tr[1]/th[1]') #得到文件名'''url = "https://img.fgowiki.com/fgo/card/equip/"+str(i)+"A.png" #图片地址img = requests.get(url)f = open("E:\\fgo\\" + str(i)+".png", 'wb')f.write(img.content) #写入到文件f.close()print(i, "finished")

 

总结

以上是生活随笔为你收集整理的【python】【爬虫】爬取Fate Grand Order wiki所有英灵礼装图鉴的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。