使用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
以上所述就是本文的全部内容了,希望对大家学习Python能够有所帮助
ERMEB云盘发卡系统官方正版系统,发卡系统操作简单、方便、易懂。 系统微信小程序前端采用nuiapp后端采用think PHP6PC前端采用vue开发 使用场景:文件上传储存,适合个人/个体/中小企业使用。本系统配合微信小程序端进行使用,文件下载以及发卡商品卡密领取都需要进入小程序内获取下载码以及卡密领取,小程序内可设置积分充值以及任务获取积分,支持微信激励广告领取文件下载码以及卡密商品,可实现
0
微信是一款手机通信软件,支持通过手机网络发送语音短信、视频、图片和文字。微信可以单聊及群聊,还能根据地理位置找到附近的人,带给大家全新的移动沟通体验,有需要的小伙伴快来保存下载体验吧!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号