1 2 3 4 5 ··· 9 下一页
摘要: from multiprocessing import Process,Queueimport os,timedef write(q): print("启动写子进程%s" % (os.getpid())) for chr in ["A","B","C","D"]: q.put(chr) time.s 阅读全文
posted @ 2019-03-15 22:39 飞飞阿 阅读(6709) 评论(0) 推荐(0) 编辑
摘要: ((http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?) 阅读全文
posted @ 2019-03-14 17:28 飞飞阿 阅读(7141) 评论(0) 推荐(0) 编辑
摘要: import urllib.requestimport reimport osdef imageCrawler(url,toPath): headers = { "User-Agnet": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.3 阅读全文
posted @ 2019-03-14 13:57 飞飞阿 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 1 raise RemoteDisconnected("Remote end closed connection without"http.client.RemoteDisconnected: Remote end closed connection without response 爬虫报错,待解 阅读全文
posted @ 2019-03-13 20:13 飞飞阿 阅读(495) 评论(0) 推荐(0) 编辑
摘要: import urllib.requestimport sslimport jsondef ajaxCrawler(url): headers = { "User-Agnet": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KH 阅读全文
posted @ 2019-03-13 19:30 飞飞阿 阅读(172) 评论(0) 推荐(0) 编辑
摘要: import urllib.request#向指定的url地址发起请求,并返回服务器响应的数据(文件的对象)#response=urllib.request.urlopen("http://www.baidu.com")#1读取文件的全部内容,会把读取到的数据赋值给一个字符串变量#data=resp 阅读全文
posted @ 2019-03-13 15:30 飞飞阿 阅读(166) 评论(0) 推荐(0) 编辑
摘要: rint(" 匹配多个字符 ")'''说明:下方的x,y,z均为假设字符,不是元字符(xyz) 匹配小括号内的xyz(作为一个整体去匹配)x? 匹配0个或者1个xx* 匹配0个或者任意多个x(尽可能多的匹配)x+ 匹配至少一个x(尽可能多的匹配)x{n} 匹配确定的n个x(n是非负整数),x不足n个 阅读全文
posted @ 2019-03-12 15:44 飞飞阿 阅读(4886) 评论(0) 推荐(0) 编辑
摘要: print(" 锚字符(边界字符) ")'''^ 行首匹配,和在[]里的^不是一个意思$ 行尾匹配\A 匹配字符串的开始,和^的区别是:\A只匹配整个字符串的开头,即使在 re.M的模式下也不会匹配其他行的行首\Z 匹配字符串结束,它和$的区别是:\Z只匹配整个字符串的开头,即使在 re.M的模式下 阅读全文
posted @ 2019-03-12 15:24 飞飞阿 阅读(889) 评论(0) 推荐(0) 编辑
摘要: import reprint(" 匹配单个字符和数字 ")'''r. 匹配除换行符以外的任意字符[0123456789] []是字符集合,表示匹配中括号内包含的任意字符[windous] 匹配'w','i','n','d','o','u','s'[a-z] 匹配任意小写字母[A-Z] 匹配任意大写字 阅读全文
posted @ 2019-03-12 13:19 飞飞阿 阅读(1482) 评论(0) 推荐(0) 编辑
摘要: #判断是不是电话号码方法1def checkPhone(str): if len(str) !=11: return False elif str[0]!="1": return False #elif str for i in str: if i>="0" or i<="9": return Tr 阅读全文
posted @ 2019-03-12 10:18 飞飞阿 阅读(1797) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 9 下一页