上一页 1 ··· 143 144 145 146 147 148 149 150 151 ··· 198 下一页
摘要: python中的正则表达式(re模块) 一、简介 正则表达式本身是一种小型的、高度专业化的编程语言,而在python中,通过内嵌集成re模块,程序媛们可以直接调用来实现正则匹配。正则表达式模式被编译成一系列的字节码,然后由用C编写的匹配引擎执行。 二、正则表达式中常用的字符含义 1、普通字符和11个 阅读全文
posted @ 2018-01-23 14:33 brady-wang 阅读(508) 评论(0) 推荐(0)
摘要: Beautiful Soup 4.2.0 文档 — Beautiful Soup 4.2.0 documentation Navigation index Beautiful Soup 4.2.0 documentation » Navigation index Beautiful Soup 4.2 阅读全文
posted @ 2018-01-22 17:30 brady-wang 阅读(407) 评论(0) 推荐(0)
摘要: import urllib.request from bs4 import BeautifulSoup import re def validateTitle(title): rstr = r"[\/\\\:\*\?\"\\|]" # '/ \ : * ? " |' new_title = re.sub(rstr, "_", title) # 替换为下划线 re... 阅读全文
posted @ 2018-01-22 17:25 brady-wang 阅读(230) 评论(0) 推荐(0)
摘要: Python3 的异常处理,在官方文档的 tutorial 中有说明。 这里把常用的异常处理方法都列出来,方便平时查找。 捕获异常基类 Python3 要求我们的异常必须继承 Exception 类。Built-in 的所有异常也都是继承自这个类。因此,我们只需要捕获这个类的实例,就可以捕获所有的异 阅读全文
posted @ 2018-01-20 22:23 brady-wang 阅读(2004) 评论(0) 推荐(0)
摘要: #coding=utf-8 import urllib.request from bs4 import BeautifulSoup from urllib import error import re ls = ['zhenrenxiu','meinv',"lianglichemo",'rentiy 阅读全文
posted @ 2018-01-20 19:28 brady-wang 阅读(24596) 评论(0) 推荐(0)
摘要: 运行平台:Windows Python版本:Python3.x IDE:Sublime text3 转载请注明作者和出处:http://blog.csdn.net/c406495762/article/details/59488464 一.urllib.error urllib.error可以接收有 阅读全文
posted @ 2018-01-20 17:49 brady-wang 阅读(515) 评论(0) 推荐(0)
摘要: #coding=utf-8 from bs4 import BeautifulSoup import urllib.request import re def validateTitle(title): rstr = r"[\/\\\:\*\?\"\\|]" # '/ \ : * ? " |' new_title = re.sub(rstr, "_", title) ... 阅读全文
posted @ 2018-01-19 18:02 brady-wang 阅读(563) 评论(0) 推荐(0)
摘要: import re def validateTitle(title): rstr = r"[\/\\\:\*\?\"\<\>\|]" # '/ \ : * ? " < > |' new_title = re.sub(rstr, "_", title) # 替换为下划线 return new_titl 阅读全文
posted @ 2018-01-19 17:59 brady-wang 阅读(1130) 评论(0) 推荐(0)
摘要: #coding=utf-8 from bs4 import BeautifulSoup import urllib.request for i in range(1,54): url = "http://www.cnblogs.com/php-linux/?page="+str(i) res = urllib.request.urlopen(url) soup = B... 阅读全文
posted @ 2018-01-19 17:19 brady-wang 阅读(359) 评论(0) 推荐(0)
摘要: from bs4 import BeautifulSoupimport urllib.requesturl = "http://www.douban.com/tag/%E5%B0%8F%E8%AF%B4/?focus=book"res = urllib.request.urlopen(url)sou 阅读全文
posted @ 2018-01-19 16:48 brady-wang 阅读(279) 评论(0) 推荐(0)
上一页 1 ··· 143 144 145 146 147 148 149 150 151 ··· 198 下一页