python
阳光下的哈巴狗
邮箱1207460050@qq.com
展开
-
selenium自动化登录滑动卡顿情况解决
简介selenium模拟登录网站,滑动图片验证码的时候卡顿解决方案1.进入python安装目录2.打开文件lib/site-packages/selenium/webdriver/common/actions/pointer_input.py3.搜索DEFAULT_MOVE_DURATION=2504.把250修改为5 #这个值自己定义,小点就行...转载 2020-07-05 15:34:56 · 1020 阅读 · 0 评论 -
contos6.x把openssl升级到1.0.2
简介python3.7.5 requests获取信息报错Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available)由于系统是CentOS release 6.x,openssl的版本为OpenSSL 1.0.1e-fips 11 Feb 2013,而python3.7需要的openssl的版本为1.0.2或者1.1.x,需要对openssl进行升级,并重新编译python3.7.5.原创 2020-07-05 15:31:53 · 1066 阅读 · 0 评论 -
python依赖包管理requirements
简介python项目依赖包管理 requirements+pipreqs生成安装环境中所有依赖包命令pip freeze >requirements.txt只需要项目中的依赖包命令pip install pipreqs #安装包 # pipregs 文件目录 pipreqs ./ #会报编码错误pipreqs ./ --encoding=utf-8 # 添加编码,若存在 requirements.txt文件会报 WARNING: Requirements.txt alr原创 2020-07-05 15:26:05 · 706 阅读 · 0 评论 -
selenium框架webdriver中driver.close()和driver.quit()关闭浏览器
前言最近服务器经常卡死导致有些采集服务没有运行,查询linux发现有大量的chromedriver进程,想起最近有个采集使用close关闭chrome,没有使用quit关闭chrome1.参看资料 1.1 close方法是关闭当前窗口 driver实例正在操作的页面,叫当前。如果当前窗口只有一个tab,那么这个close方法就相当于关闭了浏览器 1.2quit方法是直接退出并关闭所有关联的tab窗口 完全关闭浏览器,是完全的退...原创 2020-06-28 10:34:43 · 2368 阅读 · 2 评论 -
python 网页截图 + python 每日生成视频
因为工作需要用python,写了一个网页截图和每天生成视频1.网页截图 webdriver cat.pyimport timeimport osfrom selenium import webdriverdirs = time.strftime('%Y%m%d',time.localtime(time.time()))HTime = time.strftime('%H',ti...原创 2018-11-13 22:20:20 · 750 阅读 · 0 评论 -
from .cv2 import * ImportError: DLL load failed: 找不到指定的模块
1.使用pip install opencv_python 安装成功后,引用cv2 一直报错from .cv2 import * ImportError: DLL load failed: 找不到指定的模块2.使用了本地安装 pip install opencv_python‑3.4.3‑cp37‑cp37m‑win_amd64.whlopencv_python 下载网址 https:...转载 2018-11-13 22:04:49 · 1704 阅读 · 0 评论 -
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools"
Python在下载包的过程中遇到error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools提供两个解决方案:解决方案一:环境状态:win1...转载 2018-08-02 09:39:43 · 850 阅读 · 0 评论 -
python中安装包出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
问题:安装包出现Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError上述警告的意思连接超时解决办法:pip install selectivesearch -i http://pypi...转载 2018-08-01 08:43:24 · 12430 阅读 · 4 评论 -
windows下Python安装pymysql
安装pymysql命令从github 下载pymysql 安装包下载地址:https://github.com/PyMySQL/PyMySQL解压下载文件,不用打开python交互界面,cd到解压文件所在目录运行 python setup.py install打开python交互界面,运行 import pymysql,如果不报错,说明安装成功!下面是安装截图如:我的下载...转载 2018-07-23 08:52:10 · 1058 阅读 · 0 评论 -
python3 cgi中utf-8乱码问题
开头加入以下代码解决import codecs, sys sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer)转载 2018-07-22 20:02:56 · 634 阅读 · 0 评论 -
Python在Windows进行CGI编程报错Internal Server Error
最近学习python在配置环境Apache+Python+Windows后运行遇到web报错500 Internal Server Error然后进行排查首先去看了apache运行报错logs日志couldn't create child process: 720002: hello.pyAH01223: couldn't spawn child process: D:/phpStud...原创 2018-07-22 17:48:18 · 2917 阅读 · 3 评论