摘要: dir(__builtins__) help(input) 'let\'s go' #转义字符 \ r'c:\now' #字符串前加r 自动转义 str= ''' shdiufhi sdfjskldfjk dfdfsdf ''' #多行打印 isinstance(i , str) #判断是否符合st 阅读全文
posted @ 2017-05-31 20:10 御虫师 阅读(376) 评论(0) 推荐(0) 编辑
摘要: netsh winsock reset catalog 解决0x00000000c报错 阅读全文
posted @ 2017-05-30 18:45 御虫师 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 学用python也有3个多月了,用得最多的还是各类爬虫脚本:写过抓代理本机验证的脚本,写过在discuz论坛中自动登录自动发贴的脚本,写过自动收邮件的脚本,写过简单的验证码识别的脚本,本来想写google music的抓取脚本的,结果有了强大的gmbox,也就不用写了。 这些脚本有一个共性,都是和w 阅读全文
posted @ 2017-05-24 18:58 御虫师 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 在CMD命令行中,输入 “python” + “空格”,即 ”python “; 将已经写好的脚本文件拖拽到当前光标位置,然后敲回车运行即可 在CMD命令行中,输入 “python” + “空格”,即 ”python “; 将已经写好的脚本文件拖拽到当前光标位置,然后敲回车运行即可 在CMD命令行中 阅读全文
posted @ 2017-05-24 13:51 御虫师 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 前言 方法1:设置等待时间 有一些网站的防范措施可能会因为你快速提交表单而把你当做机器人爬虫,比如说以非常人的速度下载图片,登录网站,爬取信息。 常见的设置等待时间有两种,一种是显性等待时间(强制停几秒),一种是隐性等待时间(看具体情况,比如根据元素加载完成需要时间而等待) 1.显性等待时间 而且尽 阅读全文
posted @ 2017-05-24 10:17 御虫师 阅读(5441) 评论(0) 推荐(0) 编辑
摘要: git 解决fatal: Not a git repository 我用git add file添加文件时出现这样错误: fatal: Not a git repository (or any of the parent directories): .git 提示说没有.git这样一个目录,解决办法 阅读全文
posted @ 2017-05-22 15:34 御虫师 阅读(675) 评论(0) 推荐(0) 编辑
摘要: import requestsimport jsonimport redemo = requests.get('http://www.toutiao.com/api/pc/feed/?category=gallery_detail&utm_source=toutiao&max_behot_time= 阅读全文
posted @ 2017-05-21 20:36 御虫师 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 解决bs4在Python 3.5下出现“ImportError: cannot import name 'HTMLParseError'”错误 分类:Python (4251) (3) 分类:Python (4251) (3) 升级了Python3.5之后,我使用BeautifulSoup4时候出现 阅读全文
posted @ 2017-05-20 09:37 御虫师 阅读(2121) 评论(0) 推荐(0) 编辑
摘要: #encoding:utf8import reimport requestsfrom selenium import webdriverfrom selenium.webdriver.support.ui import WebDriverWaitimport timedr = webdriver.P 阅读全文
posted @ 2017-05-19 20:56 御虫师 阅读(509) 评论(0) 推荐(0) 编辑
摘要: 迭代器 迭代是Python最强大的功能之一,是访问集合元素的一种方式。 迭代器是一个可以记住遍历的位置的对象。 迭代器对象从集合等第一个元素开始访问,直到所有的元素被访问结束,迭代器只能往前不会后退。 迭代器有两个基本的方法:iter()和next() 字符串,列表或元组对象都可以用于创建迭代器。 阅读全文
posted @ 2017-05-09 19:43 御虫师 阅读(136) 评论(0) 推荐(0) 编辑