排序
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Docker中使用pip install报错 解决方法 pip install xxxxx -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip自定义源进行安装
pip默认的是国外源进行安装,可能会安装超时 使用清华源 pip install 要安装的包 -i https://pypi.tuna.tsinghua.edu.cn/simple
记录一下selenium打开chrome提示data:;解决方法
在使用selenium写爬虫时打开chrome时不能正常打开网址,地址栏出现data:; 解决方法 options = webdriver.ChromeOptions() options.add_argument('--remote-debugging-port=9222') options.binar...
pip升级失败解决方案
今天在升级pip时,发现升级失败, time out 了 于是我们可以延长他的超时时间 python -m pip --default-timeout=800 install --upgrade pip 升级成功
python使用base64报错:AttributeError: partially initialized module ‘base64’ has no attribute ‘b64encode’
python使用base64时报错:AttributeError: partially initialized module 'base64' has no attribute 'b64encode' 原因 发现文件名就是base64.py。。。 解决方法 文件改个名就好了
python爬虫IndexError: list index out of range错误
在写python爬虫时数组部分遇到了IndexError: list index out of range错误 只要加上try.....except 错误机制跳过空值就行了 try: 出问题的代码 except IndexError: pass
Python – 希尔排序算法
希尔排序是一种插入排序算法,又称作缩小增量排序。是对直接插入排序算法的改进。其基本思想是: 先取一个小于 n 的整数作为第一个增量,把全部数据分成个组。所有距离为的倍数的记录放在同一个...
Python – 直接插入排序算法
直接插入排序 把 n 个待排序的元素看成一个有序表和一个无序表, 开始时有序表中只有一个元素,无序表中有 n-1 个元素。 排序过程即每次从无序表中取出第一个元素, 将它插入到有序表中,使之成...
使用Python修改图片的MD5
MD5信息摘要算法(英语:MD5 Message-Digest Algorithm),一种被广泛使用的密码散列函数,可以产生出一个128位(16字节)的散列值(hash value),用于确保信息传输完整一致。 首先使用python...
Python如何执行JS代码
前言 爬虫的开发过程中,往往需要对JS进行模拟,简单或者通用的还可以在Python中模拟或者找到对应的第三方库,但是复杂的就可能不好实现了。所以Python执行JS语句就是爬虫开发过程中的一个痛点...