摘要: 测试过很多样式的博客园,就发现长书这样的也就是我的博客这样的抓取不了,标签不一样。其他的只需要把bky.py下的user的值即‘username’改为要抓取的用户的用户名即可,如: user = "whz0215"。 代码如下: spiders下的bky.py 以上为只需要输入用户名即可,以下为需要 阅读全文
posted @ 2018-09-23 22:39 whz_it 阅读(246) 评论(0) 推荐(0) 编辑
摘要: from io import BytesIOfrom PIL import Imagefrom selenium import webdriverfrom selenium.webdriver import ActionChainsfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui impor... 阅读全文
posted @ 2018-09-19 19:52 whz_it 阅读(358) 评论(0) 推荐(0) 编辑
摘要: import requests # network find this "https://user.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_publish_v6?" \ "qzonetoken=470760640509be33e4600487e349de76ff1e48aa6e1792a46c3e5f3... 阅读全文
posted @ 2018-09-02 23:06 whz_it 阅读(253) 评论(0) 推荐(0) 编辑
摘要: import requests from lxml import etree # xpath def get_baidu_music(): url = "http://music.taihe.com/top/dayhot" response = requests.get(url) html = response.content.decode("utf-8") re... 阅读全文
posted @ 2018-09-02 23:06 whz_it 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 配置文件 代码实现 阅读全文
posted @ 2018-07-18 16:58 whz_it 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 本程序从网上抓取免费代理IP存到文件,然后用抓取的IP抓取百度首页测试其是否可用,再用Flask框架搭建一个本地接口,可从此接口获取代理池中的代理IP,用此代理池中获取的IP抓取qq音乐热歌榜前300的歌曲信息保存到文件 从西刺代理获取代理IP 检测IP是否可用 用Flask框架搭建本地API以获取 阅读全文
posted @ 2018-07-17 16:53 whz_it 阅读(290) 评论(0) 推荐(0) 编辑
摘要: is与==的区别 a = [1,2,3] b = [1,2,3] a == b ==>True a is b ==>False 数字在-5到256时如: a = 1 b = 1 a is b ==> Trueis判断两个引用是否指向同一对象(地址),引用比较 a = [1,2,3],b = [1,2 阅读全文
posted @ 2018-05-31 19:03 whz_it 阅读(126) 评论(0) 推荐(0) 编辑
摘要: bash的配置文件 按生效范围划分 全局配置: /etc/profile /etc/profile.d/*.sh /etc/bashrc 个人配置: ~/.bash_profile ~/.bashrc 按功能划分,存在两类 profile类:为交互式登录的shell提供配置 全局:/etc/prof 阅读全文
posted @ 2018-04-15 16:41 whz_it 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 压缩,解压缩工具 compress/uncompress: .z gzip/gunzip: .gz bzip2/bunzip2: .bz2 xz/unxz: .xz zip/unzip: tar cpio 1,gzip/gunzip/zcat 压缩或解压缩后会删除原文件 gizp [option] 阅读全文
posted @ 2018-04-15 16:32 whz_it 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 使用subprocess和ThreadingTCPServer实现并发的ssh与ftp服务器,可以实现常用的cd,ls,mkdir,touch等包括其带参数的命令,more命令在小文件上行,也就是不是一次性获取结果命令还不能实现,等再研究研究,能实现文件上传下载,有一定的容错能力。 阅读全文
posted @ 2018-04-10 21:21 whz_it 阅读(215) 评论(0) 推荐(0) 编辑