摘要: beautifulsoup 获取特定html源码(无需登录页面)import refrom bs4 import BeautifulSoupimport urllib2url = 'http://www.cnblogs.com/vickey-wu/'# connect to a URLweb = u 阅读全文
posted @ 2017-05-11 23:18 随便了888 阅读(5311) 评论(0) 推荐(0) 编辑
摘要: 导入Beautifulsoup 报错 AttributeError: 'module' object has no attribute '_base' 解决方法: pip install --upgrade beautifulSoup4 pip install --upgrade html5lib 阅读全文
posted @ 2017-05-11 22:39 随便了888 阅读(1933) 评论(0) 推荐(0) 编辑
摘要: 打开pycharm,快捷键ctrl + alt + s 打开模板设置自己所需内容 完整打开路径:file>settings>editor>code style>file and code templates>python script #!/usr/bin/python# -*- coding: U 阅读全文
posted @ 2017-05-10 23:51 随便了888 阅读(1027) 评论(0) 推荐(0) 编辑
摘要: dictMerged = dict(dict1,**dict2) 阅读全文
posted @ 2017-05-10 19:15 随便了888 阅读(166) 评论(0) 推荐(0) 编辑
摘要: g = [x for x in range(3)] # 列表生成式gg = [x * x for x in range(1,100) if x % 2 == 0]G = (x for x in range(3)) # 生成器 print type(g),type(G)# 输出 # 斐波那契数列 def fib(max): n, a, b = 0, 0, 1 while n < ... 阅读全文
posted @ 2017-05-09 22:53 随便了888 阅读(233) 评论(0) 推荐(0) 编辑
摘要: {'age': {'a': '111', 'b': '2'}, 'num': [1, 2, 6], 'user': 'root'}{'age': {'a': '111', 'b': '2'}, 'num': [1, 2, 6], 'user': 'root'}{'age': {'a': '111' 阅读全文
posted @ 2017-05-08 23:24 随便了888 阅读(4354) 评论(0) 推荐(1) 编辑
摘要: 获取目录路径和文件路径 阅读全文
posted @ 2017-05-01 22:36 随便了888 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/yufeihlf/p/5717291.html 父子定位元素 查找有父亲元素的标签名为span,它的所有标签名叫input的子元素 find_element_by_css_selector("span>input") 标签名[属性=’属性值‘]:指 阅读全文
posted @ 2017-04-27 21:38 随便了888 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1、distinct去除重复项,s,d别名,order by s.time desc以时间逆序排列 select distinct s.time,d.area from server.table s,device.table d where s.id = d.id and s.time > '201 阅读全文
posted @ 2017-04-25 23:03 随便了888 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 本人遇到的情况:dead kernel & try to restart failed 查看CMD发现这个库安装有问题 解决办法 1、pip uninstall backports.shutil_get_terminal_size 2、pip install --upgrade backports. 阅读全文
posted @ 2017-04-25 21:58 随便了888 阅读(1517) 评论(0) 推荐(0) 编辑