python 微信爬虫,python信爬虫,# -*- coding
文章由Byrx.net分享于2019-03-23 05:03:48
python 微信爬虫,python信爬虫,# -*- coding
# -*- coding: utf-8 -*-import sysreload(sys)import datetimeimport timesys.setdefaultencoding("utf-8")from ghost import Ghostghost = Ghost(wait_timeout=20)url="http://weixin.sogou.com/gzh?openid=oIWsFt8JDv7xubXz5E3U41T0eFbk"page,resources = ghost.open(url)result, resources = ghost.wait_for_selector("#wxmore a")from bs4 import BeautifulSoupc=0while True: if c>=30: break soup = BeautifulSoup(ghost.content) for wx in soup.find_all("h4"): print wx page, resources = ghost.evaluate( """ var div1 = document.getElementById("wxbox"); div1.innerHTML = ''; """) ghost.click("#wxmore a") result, resources = ghost.wait_for_selector(".wx-rb3") c=c+1 pass
相关内容
- python 中缀编程工具库pipe使用方法,中缀pipe,from pipe i
- 找出a-b之间的质数,找出a-b质数,def prime(b
- 使用IP138数据库查询IP地址所在地,ip138ip,#-*- coding:
- 演示可变参数函数,可变参数函数,#演示可变参数函数
- python http上传文件处理示例,,<HTML><FORM
- 闲来无事,,,,一个“画图&quot;,闲来无事画图,im
- python自动格式化json文件,python格式化json,class JsonFo
- python计算N天之后的日期,python计算n日期,python计算N天之
- 删除空文件和空文件夹,删除文件文件夹,#-*- coding:
- 快速排序python实现。,排序python实现.,def quickSor
评论关闭