随笔 - 57  文章 - 3 评论 - 0 阅读 - 2317
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

06 2024 档案
代理检验是否可用
摘要:import reimport requestsdef get_proxies_list(num): res = requests.get(url=f"http://api.89ip.cn/tqdl.html?api=1&num={num * 2}&port=&address=&isp=").tex 阅读全文
posted @ 2024-06-30 00:05 我爱你的 阅读(6) 评论(0) 推荐(0) 编辑
yield 在爬虫中的应用-简单例子
摘要:# -*- encoding: utf-8 -*-import fakerfake = faker.Faker(locale='zh_CN')def mian(): for i in range(50000): item = {} item['num'] = i yield itemdef mian 阅读全文
posted @ 2024-06-29 18:26 我爱你的 阅读(8) 评论(0) 推荐(0) 编辑
python运行js代码拿到逆向数据-js2py库
摘要:import js2py as js2py #速度慢 而且js代码里面只能有一个函数 def method_js2py(js_path,encrypt_data): with open(js_path, 'r') as f: js_code = f.read() func = js2py.eval_ 阅读全文
posted @ 2024-06-14 03:13 我爱你的 阅读(7) 评论(0) 推荐(0) 编辑
python运行js代码拿到逆向数据-execjs库更新版
摘要:#前提安装了node.js 并且设置环境变量 https://blog.csdn.net/bestyellow/article/details/119820509 import subprocessfrom functools import partialsubprocess.Popen = par 阅读全文
posted @ 2024-06-14 02:55 我爱你的 阅读(16) 评论(0) 推荐(0) 编辑
python运行js代码拿到逆向数据-execjs库
摘要:#前提安装了node.js 并且设置环境变量 https://blog.csdn.net/bestyellow/article/details/119820509import subprocessfrom functools import partialsubprocess.Popen = part 阅读全文
posted @ 2024-06-13 16:15 我爱你的 阅读(41) 评论(0) 推荐(0) 编辑
通过接口拿到代理,返回代理列表(只有http,无https)
摘要:def get_proxies_list(num): res = requests.get(url = f"http://api.89ip.cn/tqdl.html?api=1&num={num*2}&port=&address=&isp=").text ip_list = re.compile(" 阅读全文
posted @ 2024-06-09 16:04 我爱你的 阅读(108) 评论(0) 推荐(0) 编辑
某网站加密返回数据加密_爬取过程
摘要:import jsonimport randomimport reimport subprocessfrom functools import partialfrom faker import Fakerfrom parsel import Selectorfake = Faker(locale=' 阅读全文
posted @ 2024-06-08 01:21 我爱你的 阅读(55) 评论(0) 推荐(0) 编辑
csv文件的写入和读取
摘要:from faker import Fakerfake_ = Faker(locale='zh_CN') with open('file.csv', "a", encoding="utf-8") as f: for i in range(100,8000): f.write(f"{i},{fake_ 阅读全文
posted @ 2024-06-08 01:09 我爱你的 阅读(22) 评论(0) 推荐(0) 编辑
openpyxl库写入列表数据
摘要:from openpyxl import load_workbook from typing import Union, List, IOimport openpyxlimport pandas as pdimport os def write_excel(file_full_path, value 阅读全文
posted @ 2024-06-08 00:40 我爱你的 阅读(547) 评论(0) 推荐(0) 编辑
追加写入json文件
摘要:#方便不占用内存,缺点最后写完后会多一个逗号,要自己手动删除 def begin_write_json(): with open('file.json', "w", encoding="utf-8") as f: f.write("[")def write_josn(items:dict): wit 阅读全文
posted @ 2024-06-08 00:15 我爱你的 阅读(23) 评论(0) 推荐(0) 编辑
feapder框架爬取ks评论_递归的方式
摘要:import randomimport reimport timefrom feapder.db.mysqldb import MysqlDBimport feapderdef is_number(string): pattern = re.compile(r'^[-+]?[0-9]*\.?[0-9 阅读全文
posted @ 2024-06-07 12:45 我爱你的 阅读(172) 评论(0) 推荐(0) 编辑
python各种加解密方法
摘要:# -*- encoding: utf-8 -*- from hashlib import md5import base64 # MD5加密obj = md5()str = "你是个小可爱"obj.update(str.encode("utf-8"))# obj.update("wusir".enc 阅读全文
posted @ 2024-06-07 10:52 我爱你的 阅读(58) 评论(0) 推荐(0) 编辑
zf_利用feapder中的selenium网页爬取数据
摘要:"http://www.ccgp.gov.cn/cggg/dfgg/"#个人学习用切勿其他用途# 标题 name# 发布时间 publish_time# 地域 location# 采购人 purchaser# 采购网址 url#前提配置数据库安装feapder库 import randomimpor 阅读全文
posted @ 2024-06-03 21:47 我爱你的 阅读(31) 评论(0) 推荐(0) 编辑
feapder通过selenium爬取网页数据-用到yield关键字可循环爬取
摘要:import randomimport timeimport feapderfrom feapder.utils.webdriver import WebDriverfrom parsel import Selectorfrom feapder.db.mysqldb import MysqlDBfr 阅读全文
posted @ 2024-06-01 22:31 我爱你的 阅读(68) 评论(0) 推荐(0) 编辑
xpathhelper快捷键
摘要:ctrl+shift+x 阅读全文
posted @ 2024-06-01 21:26 我爱你的 阅读(3) 评论(0) 推荐(0) 编辑
随机范围小数和随机范围整数
摘要:import random random_num = random.randint(1,100) random_float = round(random.uniform(0.5, 1.5), 1) 阅读全文
posted @ 2024-06-01 19:32 我爱你的 阅读(4) 评论(0) 推荐(0) 编辑
parsel库提取网页数据
摘要:from parsel import Selector sel = Selector(ct)url0 = sel.xpath('//select[@class="pageselect"]/option/@value').getall()#xpath提取url1 = sel.css('//select 阅读全文
posted @ 2024-06-01 11:33 我爱你的 阅读(4) 评论(0) 推荐(0) 编辑
feapder框架爬虫实战
摘要:# -*- coding: utf-8 -*-"""Created on 2024-05-31 10:21:56 @summary: @author: me"""import jsonfrom feapder.db.mysqldb import MysqlDBimport feapder"""# M 阅读全文
posted @ 2024-06-01 11:32 我爱你的 阅读(147) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示