import zipfile with zipfile.ZipFile(r'E:/Python爬虫精进.zip','r') as f: for 文件名 in f.namelist(): 信息=f.getinfo(文件名) 文件名=文件名.encode('cp437').decode('gbk') p ...
分类:
其他好文 时间:
2020-07-11 12:28:20
阅读次数:
76
做项目遇到请求对方页面,对方返回的参数串直接拼接到我的URL上,是一个加密串. 因为忘记了之前有URLEncoder这个步骤, 解密的时候没有使用URLDecoder进行解密, 直接使用AES解密遇到报错, Input length must be multiple of 16 when decry ...
分类:
其他好文 时间:
2020-07-10 12:57:16
阅读次数:
103
爬取素材库。直接存入mysql数据库。 包含html源码直接存入数据库需要的转义函数。 替换掉源码中的html注释语句 import re import requests import random import time from bs4 import BeautifulSoup import p ...
分类:
数据库 时间:
2020-07-08 23:04:25
阅读次数:
80
不同的应用如果都需要redis,,可以创建多个 pool = redis.ConnectionPool(host='127.0.0.1', port=6379, decode_responses=True,db=1)r1 = redis.Redis(connection_pool=pool)r1.f ...
分类:
其他好文 时间:
2020-07-08 15:43:04
阅读次数:
65
如果硬盘空间够大,下载最新的版本。 由于所有代码都是从隐藏的 .repo 目录中 checkout 出来的,下载后解压 再 repo sync 一遍即可得到完整的目录。 使用方法如下: wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly ...
分类:
其他好文 时间:
2020-07-08 15:36:30
阅读次数:
84
做加密时,传到后台出现%20 %3D等,导致解密错误,原因是特殊字符被转义编码,解决方案: try { ciphertext = URLDecoder.decode(ciphertext,"UTF-8"); } catch (UnsupportedEncodingException e) { e.p ...
分类:
Web程序 时间:
2020-07-07 15:28:32
阅读次数:
97
html页面: js文件里添加以下代码:{field: 'uid', title: __('解绑'), table: table, buttons: [ { name: 'ajax', text: __('解绑'), title: __('解绑'), classname: 'btn btn-xs b ...
分类:
Web程序 时间:
2020-07-06 17:58:26
阅读次数:
387
文本组件,只能嵌套自身 --在小程序中只有这个标签 长按文字时可以复制,需要为text标签添加selectable属性 <text selectable>长按文字,复制这一段话</text> --可以对空格 回车 进行编码,需要为text标签添加decode属性 如果不为text设置decode属性 ...
分类:
微信 时间:
2020-07-05 22:51:34
阅读次数:
107
问题: 执行代码过程中抛出异常:JSONDecodeError: Expecting value: line 1 column 1 (char 0) 原因: 需要转换为json格式的参数不符合json格式 json格式中,键值必须用单引号或双引号引起来,而传递的参数键值没有使用引号引起来,在转换为j ...
分类:
Web程序 时间:
2020-07-05 21:27:42
阅读次数:
69
decode()函数的作用是用作解码,encode()函数是用作编码。 decode函数以encoding指定的编码格式解码字符串,默认是字符串编码。 语法是: str.decode(encoding='utf-8') encode函数以encoding指定的编码格式编码字符串。 语法是: str. ...
分类:
编程语言 时间:
2020-07-05 00:52:12
阅读次数:
72