文章分类 -  python error 分析与解决办法

摘要:在接口测试过程中,为了取值将形如字典形式的字符串使用eval()方法转化成字典方便取值 str={"code":100,"num":1,"data":5} 当值不是null时可以使用eval(str)正常转为字典 strnull={"code":100,"num":1,"data":[null]} 阅读全文
posted @ 2018-06-18 12:17 秋华 编辑
摘要:应该是browser对象关闭之后你又使用了 阅读全文
posted @ 2018-06-16 16:32 秋华 编辑
摘要:一:下载pywin32安装包 1.访问参考资料中的pywin32下载地址 2.下载与已安装python版本对应的pywin32安装包,例如python3.4 64位对应的安装包为pywin32-218.win-amd64-py3.4.exe 二:安装下载好的pywin32安装包,双击运行一路下一步即 阅读全文
posted @ 2018-06-10 21:26 秋华 编辑
摘要:安装visual stdio 2017后依然报错:Unable to find vcvarsall.bat 解决办法:更新setuptools 原文章:https://blog.csdn.net/wl0909/article/details/79098154 阅读全文
posted @ 2018-06-10 09:47 秋华 编辑
摘要:(error) DENIED Redis is running in protected mode because protected mode is enabled 原文章:https://blog.csdn.net/Agly_Clarlie/article/details/52251746 Re 阅读全文
posted @ 2018-06-08 15:05 秋华 编辑
摘要:安装python时出现Ignoring ensurepip failure:pip required SSL/TLS 因为没有安装OpenSSL 使用yum install openssl-devel 阅读全文
posted @ 2018-06-06 18:43 秋华 编辑
摘要:方法一、 1、打开 vi /etc/sysconfig/network-scripts/ifcfg-enp4s0(每个机子都可能不一样,但格式会是“ifcfg-e...”)。但内容包含: <strong>TYPE=Ethernet #网卡类型 DEVICE=eth0 #网卡接口名称 ONBOOT=n 阅读全文
posted @ 2018-06-06 18:41 秋华 编辑
摘要:原链接:https://blog.csdn.net/vito21/article/details/53490435 今天爬一个网站的内容,在写入TXT文件时,某些页面总是报UnicodeEncodeError: ‘gbk’ codec can’t encode character错误,网上找了半天也 阅读全文
posted @ 2018-06-05 10:52 秋华 编辑
摘要:解决办法: 代码中设置参数: path_wk = r‘D:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe‘ #wkhtmltopdf安装位置 config = pdfkit.configuration(wkhtmltopdf = path_wk) 最后执 阅读全文
posted @ 2018-06-02 09:32 秋华 编辑
摘要:解决方法: 设置了Accept头后解决了,但是还是不知道原因 阅读全文
posted @ 2018-05-27 19:03 秋华 编辑
摘要:在练习urllib操作中,遇到了url中含有中文字符的问题。比如http://dotamax.com/,看下源码的话,上方的搜索框的name=p,输入内容点击搜索以后,通过GET方法进行传递,比如我们搜索”意“,url变为http://dotamax.com/search/?q=意。但是url中是不 阅读全文
posted @ 2018-04-13 16:21 秋华 编辑
摘要:关键字参数必须跟随在位置参数后面! 因为python函数在解析参数时, 是按照顺序来的, 位置参数是必须先满足, 才能考虑其他可变参数. 阅读全文
posted @ 2018-04-11 16:18 秋华 编辑
摘要:windows系统上出现这个问题的解决需要安装Py32Win模块,但是直接通过官网链接装exe会出现几百个错误,更方便的做法是 阅读全文
posted @ 2018-02-05 22:20 秋华 编辑
摘要:今天在使用pip install scrapy 命令安装Scrapy爬虫框架时,出现了很让人头疼的错误,错误截图如下: 在网上查找解决方法时,大致知道了问题的原因。是因为缺少C语言的编译环境,其中一种解决方法就是安装相对应版本的Visual Studio,但是安装VS本身就极其麻烦,所以这种方法是不 阅读全文
posted @ 2018-02-05 22:17 秋华 编辑
摘要:可用链接:http://blog.csdn.net/dushu990/article/details/51767189 使用python3.5.1执行post请求时,一直报错"POST data should be bytes or an iterable of bytes. It cannot b 阅读全文
posted @ 2018-01-18 20:50 秋华 编辑
摘要:可用链接: 1.http://blog.csdn.net/heatdeath/article/details/71136174 2.https://www.cnblogs.com/yousuosiyss/p/6882420.html?utm_source=itdadao&utm_medium=ref 阅读全文
posted @ 2018-01-17 21:43 秋华 编辑
摘要:import re from common_p3 import download def crawl_sitemap(url): sitemap = download(url) links = re.findall('(.*?)',sitemap) print('links=',links) for link in links: print('l... 阅读全文
posted @ 2017-12-27 11:44 秋华 编辑
摘要:import numpy as np #data 原来数组 #arr_1 新数组 #将data的第一列赋值给arr_1的第一列 arr_1 = np.array((data.shape[0],5)) arr_1[:,0] = data[:,0] #报错 # arr_1[:,0] = data[:,0]#id #IndexError: too many indices for ar... 阅读全文
posted @ 2017-11-15 14:01 秋华 编辑