• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > python3简单实现微信爬虫

python3简单实现微信爬虫

作者:hebedich 字体:[增加 减小] 来源:互联网

hebedich 通过本文主要向大家介绍了python3爬虫教程,python3 网络爬虫,python3 爬虫,python3网络爬虫教程,python3爬虫入门教程等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

使用ghost.py 通过搜搜 的微信搜索来爬取微信公共账号的信息

# -*- coding: utf-8 -*-
import sys
reload(sys)
import datetime
import time
sys.setdefaultencoding("utf-8")
 
from ghost import Ghost
ghost = 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 BeautifulSoup
c=0
while 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
</div>

以上所述就是本文的全部内容了,希望对大家学习Python能够有所帮助

</div>

您可能想查找下面的文章:

  • python3中int(整型)的使用教程
  • python3中int(整型)的使用教程
  • python3制作捧腹网段子页爬虫
  • Python常用的爬虫技巧总结
  • Python使用爬虫猜密码
  • Python使用爬虫猜密码
  • python实现爬虫统计学校BBS男女比例之数据处理(三)
  • python实现爬虫统计学校BBS男女比例(一)
  • python实现爬虫统计学校BBS男女比例(一)
  • python3简单实现微信爬虫

相关文章

  • Python存取XML的常见方法实例分析
  • python循环监控远程端口的方法
  • Django集成百度富文本编辑器uEditor攻略
  • python私有属性和方法实例分析
  • Python学习笔记之常用函数及说明
  • 跟老齐学Python之编写类之一创建实例
  • Python多线程、异步+多进程爬虫实现代码
  • 用Python编写web API的教程
  • python通过shutil实现快速文件复制的方法
  • python中redis的安装和使用

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python下Fabric的简单部署方法
    • 解析Python编程中的包结构
    • Linux下将Python的Django项目部署到Apache服务器
    • Python实现Windows上气泡提醒效果的方法
    • python通过邮件服务器端口发送邮件的方法
    • python中合并两个文本文件并按照姓名首字母排序的例子
    • 用Python编写一个国际象棋AI程序
    • Python 拷贝对象(深拷贝deepcopy与浅拷贝copy)
    • 基于Python的身份证号码自动生成程序
    • 理解Python中函数的参数

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有