摘要: import urllib.requestimport reimport randomimport urllib.erroruapools=[ 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; 360SE)', 'Mozilla/5.0 (Win 阅读全文
posted @ 2017-11-23 20:26 沧海一粒水 阅读(143) 评论(0) 推荐(0) 编辑
摘要: import urllib.requestdef ip(): thisip=urllib.request.urlopen('http://tvp.daxiangdaili.com/ip/?tid=559796713225033&num=1&foreign=only').read().decode() 阅读全文
posted @ 2017-11-23 08:54 沧海一粒水 阅读(136) 评论(0) 推荐(0) 编辑
摘要: import randomimport urllib.requestippools=[ "39.104.50.71:8080", "39.104.50.160:8080", "39.104.14.202:8080", "39.104.50.137:8080", "39.104.50.29:8080" 阅读全文
posted @ 2017-11-22 22:20 沧海一粒水 阅读(115) 评论(0) 推荐(0) 编辑
摘要: import reimport urllib.requestimport randomfrom docx import Documentdocument = Document()document.add_heading('糗事百科',1)uapools=[ 'Mozilla/4.0 (compati 阅读全文
posted @ 2017-11-22 19:30 沧海一粒水 阅读(197) 评论(0) 推荐(0) 编辑
摘要: import reimport urllib.requestfrom docx import Documentheader=("User-Agent",'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML 阅读全文
posted @ 2017-11-21 22:19 沧海一粒水 阅读(158) 评论(0) 推荐(0) 编辑
摘要: import reimport urllib.requestimport urllib.errorurl="http://blog.csdn.net"header=("User-Agent",'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883... 阅读全文
posted @ 2017-11-21 18:10 沧海一粒水 阅读(342) 评论(0) 推荐(0) 编辑
摘要: import urllib.requesturl="http://blog.csdn.net"header=("User-Agent",'User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like G 阅读全文
posted @ 2017-11-20 21:43 沧海一粒水 阅读(143) 评论(0) 推荐(0) 编辑
摘要: import urllib.requestimport urllib.errortry: data =urllib.request.urlopen("http://blog.csdn.net").read() print(data.decode())except urllib.error.URLEr 阅读全文
posted @ 2017-11-20 21:42 沧海一粒水 阅读(149) 评论(0) 推荐(0) 编辑
摘要: import urllib.requestimport reimport xlwtdata=urllib.request.urlopen("https://read.douban.com/provider/all").read().decode()pat='[\u4e00-\u9fa5].*?'new_data=re.compile(pat).findall(data)book=xlwt.Work... 阅读全文
posted @ 2017-11-17 08:26 沧海一粒水 阅读(186) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> .pghd{ height:48px; background-color:goldenrod; color:orchid 阅读全文
posted @ 2017-11-13 13:52 沧海一粒水 阅读(187) 评论(0) 推荐(0) 编辑