摘要: #异步并发爬虫的框架 #网址池:用于过滤重复的网址(因为会出现转发、或者不同页面出现相同商品的链接的情况) #网址池:突然断网等,因为其他原因下载器出现错误。网址池需要记录下来。设置失败三次之后就不再下载,标记为有问题的网址 #多个下载器 这里可以使用异步(协程aiohttp)并发的下载 #HTML 阅读全文
posted @ 2021-10-06 01:28 山水无期 阅读(54) 评论(0) 推荐(0)
摘要: import aiohttp import asyncio import time async def get_requests(url): async with aiohttp.ClientSession() as session: async with await session.get(url 阅读全文
posted @ 2021-10-06 01:04 山水无期 阅读(77) 评论(0) 推荐(0)
摘要: import requests import cchardet import traceback from lxml import etree def downloader(url,timeout = 10,headers = None,debug = False, binary = False): 阅读全文
posted @ 2021-10-06 00:57 山水无期 阅读(55) 评论(0) 推荐(0)
摘要: import random #一维示例 test_arry = [11,12,13,15,18,20,29,35,40,55,68,70,92,105,107,109] #最后一个数如果不是109,而是200,如何等比例、等长度的将这个列表进行放大的操作 #先计算缩放比例 rate = 200/te 阅读全文
posted @ 2021-10-06 00:50 山水无期 阅读(280) 评论(0) 推荐(0)
摘要: //浏览器内存漫游解决方案(js逆向) //原理通过ast把所有的变量,参数中间值进行内存的存储 //搜索AST-hook,进入github //现在github的库下载下来 //anyproxy nodejs中的抓包工具 需要安装(管理员的) npm install -g anyproxy //然 阅读全文
posted @ 2021-10-06 00:34 山水无期 阅读(1273) 评论(0) 推荐(0)
摘要: //第一种 补环境的方法 let test1 = { name:"小红" }; test = new Proxy(test1,{ get(target,key){ console.log("获取了",key + "属性"); return target[key]; } }) test.name // 阅读全文
posted @ 2021-10-06 00:05 山水无期 阅读(4498) 评论(0) 推荐(0)