CFm透视挂(免费版)利用爬虫代码美女写真套图下载转PDF保存
发布时间:2025-11-04 05:03:10 作者:玩站小弟
我要评论
爬的利用不是全站链接,该爬虫爬的爬虫CFm透视挂(免费版)是每套图的链接,相当于是代码辅助低价发卡网详情页的链接需要单独下载的python库requestsfake_useragentxpathPIL下面有图片 打码是为了过审,这网站真的美女游戏开挂器(永久免费)是正经的写真网站不是什么老司机网站import requests from fake_useragent import UserAgent from lxml import etree import os import aiohttp import asyncio from PIL import Image import shutil #获取详情页全部图片函数 async def get_xq(url): #计数 p=0 tasks = [] res = requests.get(url=url,headers=header) res.encoding="utf-8" res.close() tree = etree.HTML(res.text) #图片标题 imgtitle = tree.xpath(//title/text())[0] global title title = imgtitle #第一页的图片链接 img = tree.xpath(//article//img/@src) imgurl = ["https://www.xgyw01.co" + i for i in img] print("当前下载的套图标题:\n"+imgtitle) for i in imgurl: p += 1 tasks.append(down(i,imgtitle,p)) #获取下一页的链接 next = "https://www.xgyw01.co" + tree.xpath(//div[@class="pagination"][1]//a[last()]/@href)[0] #判断的条件 bool = tree.xpath(//div[@class="pagination"][1]//a[last()]/text())[0] #循环获取所有页 while True: print("正在获取"+next) if bool == "下一页" or bool == "下页": res = requests.get(url=next, headers=header) res.encoding = "utf-8" res.close() tree = etree.HTML(res.text) img = tree.xpath(//article//img/@src) imgurl = ["https://www.xgyw01.co" + i for i in img] for i in imgurl: p += 1 tasks.append(down(i,imgtitle,p)) #判断的条件 bool = tree.xpath(//div[@class="pagination"][1]//a[last()]/text())[0] if bool == "下一页" or bool == "下页": next = "https://www.xgyw01.co" + tree.xpath(//div[@class="pagination"][1]//a[last()]/@href)[0] continue else: break else: break print("开始异步下载图片.....") await asyncio.wait(tasks) #下载函数 async def down(url,filename,fn): filepath = os.path.join(dirdz,filename) if not os.path.exists(filepath): os.mkdir(filepath) async with aiohttp.ClientSession() as session: async with session.get(url) as res: with open(filepath+"/"+str(fn)+".jpg",mode="wb") as f: f.write(await res.content.read()) print(f"第{fn}张下载完成") #写真图片转PDF函数 def jpg_pdf(filename): # 定义文件夹路径和PDF文件名 folder_path = os.path.join(dirdz,filename) pdf_filename = os.path.join(dirdz,filename + ".pdf") # # 将JPEG文件转换为Pillow Image对象并添加到列表中 image_files = [os.path.join(folder_path, f) for f in os.listdir(folder_path) if f.endswith(.jpeg) or f.endswith(.jpg)] image_list = [] for file_path in image_files: img = Image.open(os.path.abspath(file_path)) image_list.append(img) # 找到所有JPEG文件 image_list[0].save(pdf_filename, "PDF" ,resolution=100.0, save_all=True, append_images=image_list[1:]) print("pdf合并完成,删除缓存的的图片") shutil.rmtree(folder_path) print("清理完成") #主函数 if __name__ == __main__: #定义的公共请求头 header = {"user-agent": UserAgent().random} #定义的保存路径(文件夹路径) dirdz = "这里输入保存的文件夹路径" #定义一个全局的标题保存文件名字 title = "" #爬取的网站是:https://www.xgyw01.co/,找到想下的写真下载CF作弊菜单(悬浮球)套图直接点进去复制详情页的链接就行了 url = input("请输入套图详情页链接:") #使用异常捕获排除异常 try: #因为是异步函数所以需要用asyncio.run启动 asyncio.run(get_xq(url)) print(title) except: print("链接详情页解析错误.........") print("全部下载完成,开始生成pdf.......") #调用图片转PDF函数 jpg_pdf(title) 。
爬的利用不是全站链接,该爬虫爬的爬虫CFm透视挂(免费版)是每套图的链接 ,相当于是代码辅助低价发卡网详情页的链接
需要单独下载的python库

requests

fake_useragent

xpath
PIL
下面有图片 打码是为了过审 ,这网站真的美女游戏开挂器(永久免费)是正经的写真网站不是什么老司机网站
import requests from fake_useragent import UserAgent from lxml import etree import os import aiohttp import asyncio from PIL import Image import shutil #获取详情页全部图片函数 async def get_xq(url): #计数 p=0 tasks = [] res = requests.get(url=url,headers=header) res.encoding="utf-8" res.close() tree = etree.HTML(res.text) #图片标题 imgtitle = tree.xpath(//title/text())[0] global title title = imgtitle #第一页的图片链接 img = tree.xpath(//article//img/@src) imgurl = ["https://www.xgyw01.co" + i for i in img] print("当前下载的套图标题:\n"+imgtitle) for i in imgurl: p += 1 tasks.append(down(i,imgtitle,p)) #获取下一页的链接 next = "https://www.xgyw01.co" + tree.xpath(//div[@class="pagination"][1]//a[last()]/@href)[0] #判断的条件 bool = tree.xpath(//div[@class="pagination"][1]//a[last()]/text())[0] #循环获取所有页 while True: print("正在获取"+next) if bool == "下一页" or bool == "下页": res = requests.get(url=next, headers=header) res.encoding = "utf-8" res.close() tree = etree.HTML(res.text) img = tree.xpath(//article//img/@src) imgurl = ["https://www.xgyw01.co" + i for i in img] for i in imgurl: p += 1 tasks.append(down(i,imgtitle,p)) #判断的条件 bool = tree.xpath(//div[@class="pagination"][1]//a[last()]/text())[0] if bool == "下一页" or bool == "下页": next = "https://www.xgyw01.co" + tree.xpath(//div[@class="pagination"][1]//a[last()]/@href)[0] continue else: break else: break print("开始异步下载图片.....") await asyncio.wait(tasks) #下载函数 async def down(url,filename,fn): filepath = os.path.join(dirdz,filename) if not os.path.exists(filepath): os.mkdir(filepath) async with aiohttp.ClientSession() as session: async with session.get(url) as res: with open(filepath+"/"+str(fn)+".jpg",mode="wb") as f: f.write(await res.content.read()) print(f"第{fn}张下载完成") #写真图片转PDF函数 def jpg_pdf(filename): # 定义文件夹路径和PDF文件名 folder_path = os.path.join(dirdz,filename) pdf_filename = os.path.join(dirdz,filename + ".pdf") # # 将JPEG文件转换为Pillow Image对象并添加到列表中 image_files = [os.path.join(folder_path, f) for f in os.listdir(folder_path) if f.endswith(.jpeg) or f.endswith(.jpg)] image_list = [] for file_path in image_files: img = Image.open(os.path.abspath(file_path)) image_list.append(img) # 找到所有JPEG文件 image_list[0].save(pdf_filename, "PDF" ,resolution=100.0, save_all=True, append_images=image_list[1:]) print("pdf合并完成,删除缓存的的图片") shutil.rmtree(folder_path) print("清理完成") #主函数 if __name__ == __main__: #定义的公共请求头 header = {"user-agent": UserAgent().random} #定义的保存路径(文件夹路径) dirdz = "这里输入保存的文件夹路径" #定义一个全局的标题保存文件名字 title = "" #爬取的网站是:https://www.xgyw01.co/ ,找到想下的写真下载CF作弊菜单(悬浮球)套图直接点进去复制详情页的链接就行了 url = input("请输入套图详情页链接:") #使用异常捕获排除异常 try: #因为是异步函数所以需要用asyncio.run启动 asyncio.run(get_xq(url)) print(title) except: print("链接详情页解析错误.........") print("全部下载完成,开始生成pdf.......") #调用图片转PDF函数 jpg_pdf(title)

相关文章
源码介绍:一款功能全面 ,用户交互良好,数据本地缓存,集成邮箱验证,在线投稿,内置Mardown编辑器) ,快捷评论的的博客资讯APP。同时兼容H5和微信小程序源码。基于Typoche博客程序开发,后端接2025-11-04
下载高得地图能够为用户提供AI智能导航,软件将智能为用户规划行驶路线,软件中还将会为用户提供语言导航,路口监控红绿灯都将会为用户进行提示,下载高得地图中还将会为用户提供打车服务,支持多种不同价位的打车2025-11-04
RyujinX模拟器是专业的switch模拟器 ,帮助用户能够轻松在手机等多端畅玩海量NS游戏资源,在平台中将会为用户提供超多的功能 ,软件中将为用户提供超多的功能选项,RyujinX模拟器将支持各种不同2025-11-04
windy蓝色天气是蓝色版本的windy软件,本版本能够为用户提供更加精简的天气预报平台工具服务 ,可以方便用户进行使用,轻松查看各个地区的天气情况 ,windy蓝色天气将减少专业的图表数据,为用户提供更2025-11-04
源码介绍:一款开源的云塔idc源码,可搭建自己服务器私有IDC这是一款idc 源码现在也算是古老的东西,我也是在网上找到的 ,可以把自己闲置的云服务器变成虚拟机使用。1.上传到服务器,主机 ,直接解压访i2025-11-04
捏咔捏脸可以为用户提供自由捏脸的玩法,轻松通过捏脸的方式来制作专属的个性化头像,软件中将会为用户提供多种不同的工具,捏咔捏脸让用户能够通过这些工具,轻松挑战头像中各个组件的色彩,软件中将会为用户提供专2025-11-04

最新评论