xxxxxxxxxx
来源:互联网 发布:梦幻西游数据错误 编辑:程序博客网 时间:2024/05/30 02:52
import urllibfrom urllib import requestimport timedef GetInfo(url): headers = {'Host':'blog.csdn.net','Upgrade-Insecure-Requests':'1','User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36 115Browser/8.4.0','Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8','Accept-Encoding':'deflate','Accept-Language':'zh-CN,zh;q=0.8','Cookie':'uuid_tt_dd=5534972241583295096_20170723; Hm_lvt_ae0da6ae5315ea17b7070248c46e786d=1500801364; bdshare_firstime=1500801363575; __message_sys_msg_id=0; __message_gu_msg_id=0; __message_cnel_msg_id=0; __message_in_school=0; uuid=251f31c7-a055-4dbd-a1e2-860d7bc69162; avh=77069612; Hm_lvt_6bcd52f51e9b3dce32bec4a3997715ac=1502173673,1502173724,1502266846,1502360077; Hm_lpvt_6bcd52f51e9b3dce32bec4a3997715ac=1502360077; dc_tos=ougsgd; dc_session_id=1502360077644_0.7990083903386638','If-None-Match':'W/"f75bf97f893364efa173f6d16d06ff15"'} data = None try: req = urllib.request.Request(url,data,headers) res = urllib.request.urlopen(req) html = res.read().decode("utf-8") #print(html) #input() except: print('error') html = '' return html if __name__ == '__main__': while True: url = 'http://blog.csdn.net/neejack/article/details/77426425' html = GetInfo(url) try: SP = html.index('"阅读次数">')+7 EP = html.index('人阅读') cnt = html[SP:EP] print('c',cnt) except: print('') time.sleep(180)
阅读全文
0 0
- xxxxxxxxxx
- xxxxxxxxxx
- XXXXXXXXXX
- XXXXXXXXXX
- xxxxxxxxxx
- gzexe.XXXXXXXXXX decode
- 未能正确加载包"XXXXXXXXXX"
- 对路径“XXXXXXXXXX”的访问被拒绝。
- svn错误 Error Aborting commit: 'XXXXXXXXXX'
- The value for the useBean class attribute xxxxxxxxxx is invalid.
- 退出程序时读取0xXXXXXXXXX时发生访问冲突
- error LNK2001: unresolved external symbol "public: static XXXXXXXXXX
- Failed to resolve: com.afollestad:material-dialogs:xxxxxxxxxx
- 打包遇到错误:missing ios distribution signing identity for XXXXXXXXXX
- 打包遇到错误:missing ios distribution signing identity for XXXXXXXXXX
- ssh: connect to xxxxxxxxxx port 22: Connection refused
- The literal XXXXXXXXXX of type int is out of range 处理办法
- "kewastUnPackStats(): bad magic 1 (0xXXXXXXXXX, 0)" in Alert Logfile After Upgrading to 11.2.0.1 (文档
- 【hdu 2063】过山车(二分图)
- Axure RP8 教程 :基础元件
- 代理模式
- 最长公共子序列学习篇。动态规划
- spring mvc 内外部视图
- xxxxxxxxxx
- 【HDU1556-color the ball】(树状数组)
- A. Counting Kangaroos is Fun----暴力
- (原创)clang的python接口(一)
- spark-1.2.0 集群环境搭建(完整一套)
- wordpress开发
- spring事务的更新丢失
- [编程题] 消除重复元素
- codeforces 831A Unimodal Array