phantomjs和selenium模拟登陆qq空间
# -*- coding: utf-8 -*-
from selenium import webdriver
import time driver =webdriver.PhantomJS()
driver.maximize_window() def get_shuoshuo():
driver.get('https://user.qzone.qq.com/177472465') try:
driver.find_element_by_id('login_div')
a = True
except:
a = False if a==True:
driver.switch_to.frame('login_frame')
driver.find_element_by_id('switcher_plogin').click()
driver.find_element_by_id('u').clear()
driver.find_element_by_id('u').send_keys('')
driver.find_element_by_id('p').clear()
driver.find_element_by_id('p').send_keys('we2')
driver.find_element_by_id('login_button').click()
time.sleep(3)
driver.implicitly_wait(3) try:
driver.find_element_by_id('QM_OwnerInfo_Icon')
b = True
except:
b = False if b==True:
time.sleep(3)
driver.switch_to.frame('QM_Feeds_Iframe')
content =driver.find_element_by_id('host_home_feeds').get_attribute('innerHTML')
print content
driver.close()
driver.quit() if __name__ == '__main__':
get_shuoshuo()
https://zhuanlan.zhihu.com/p/25006226
phantomjs和selenium模拟登陆qq空间的更多相关文章
- python selenium模拟登陆qq空间
不多说.直接上代码 from selenium import webdriver driver = webdriver.Chrome() driver.get('http://qzone.qq.com ...
- 使用Python+Selenium模拟登录QQ空间
使用Python+Selenium模拟登录QQ空间爬QQ空间之类的页面时大多需要进行登录,研究QQ登录规则的话,得分析大量Javascript的加密解密,这绝对能掉好几斤头发.而现在有了seleniu ...
- Selenium模拟登陆百度贴吧
Selenium模拟登陆百度贴吧 from selenium import webdriver from time import sleep from selenium.webdriver.commo ...
- selenium firefox 提取qq空间相册链接
环境: selenium-java 3.9.1 firefox 57.0 geckodriver 0.19.1 1.大概的思路就是模拟用户点击行为,关于滚动条的问题,我是模拟下拉箭头,否则只能每个相册 ...
- selenium iframe 定位 qq空间说说
selenium iframe 定位 qq空间说说
- selenium 模拟登陆豆瓣,爬取武林外传的短评
selenium 模拟登陆豆瓣,爬去武林外传的短评: 在最开始写爬虫的时候,抓取豆瓣评论,我们从F12里面是可以直接发现接口的,但是最近豆瓣更新,数据是JS异步加载的,所以没有找到合适的方法爬去,于是 ...
- 使用selenium模拟登陆新浪微博
1.selenium基本使用 1.selenium安装及基本操作 selenium是一个自动化测试工具,它支持各种浏览器,包括Chrome,Safari,Firefox等主流界面浏览器驱动,也包括Ph ...
- C# 13行代码带你模拟登录QQ空间
最近想做一个QQ空间点赞的小工具,于是晚上下班回来就开始分析PC版的QQ空间,打开Chrome,切换到Network,然后输入账号密码,然后点击登录... 然后,我曹....一堆请求就开始了....搞 ...
- Python爬虫实战:使用Selenium抓取QQ空间好友说说
前面我们接触到的,都是使用requests+BeautifulSoup组合对静态网页进行请求和数据解析,若是JS生成的内容,也介绍了通过寻找API借口来获取数据. 但是有的时候,网页数据由JS生成,A ...
随机推荐
- nginx+php-fpm结构模型剖析及优化(转载)
一.nginx和php-fpm的关系和分工 nginx是web服务器,php-fpm是一个PHPFastCGI进程管理器,两者遵循fastcgi的协议进行通信,nginx负责静态类似html文件的处理 ...
- 轻量级自动化工具 pssh
pssh应用场景 pssh是一个用python编写的可以并发在多台服务器上批量执行命令的工具,它支持文件并行复制,远程并行执行命令,其中文件并行复制是pssh的核心功能,也是同类工具中的一个亮点. 要 ...
- 【CSS】多行溢出显示省略号
display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;//超出三行隐藏 overflow: hidden; ...
- PHP开发环境搭建一:PHP集成环境XAMPP 的安装与配置
1. XMAPP简介 XAMPP(Apache+MySQL/MariaDB+PHP+Perl)开头的X代表X-OS,代表可以在任何常见操作系统下使用,包括Windows.Mac.Linux,开源平台. ...
- 【linux】【指令】systemctl 指令部分解读
systemctl [OPTIONS...] {COMMAND} ... Query or send control commands to the systemd manager. -h --hel ...
- ERROR 1005 (HY000): Can't create table 'students.#sql-d9
今天在创建外键的时候出现以下错误 ERROR 1005 (HY000): Can't create table 'students.#sql-d99_3' (errno: 150) 格式 ...
- B1018 锤子剪刀布 (20分)
B1018 锤子剪刀布 (20分) 大家应该都会玩"锤子剪刀布"的游戏:两人同时给出手势. 现给出两人的交锋记录,请统计双方的胜.平.负次数,并且给出双方分别出什么手势的胜算最大. ...
- 如何将Windows live writer草稿转存到其他电脑上
ref:http://www.zhengsiwei.com/how-to-draft-windows-live-writer-archived-on-other-computers/ 在写一篇关于 ...
- 奇异值分解(SVD)原理详解及推导
在网上看到有很多文章介绍SVD的,讲的也都不错,但是感觉还是有需要补充的,特别是关于矩阵和映射之间的对应关系.前段时间看了国外的一篇文章,叫A Singularly Valuable Decompos ...
- ListView Viewholder的坑 线性布局的坑
1.ListView Viewholder的坑 /** * 默认带图片的menu adapter */ public static class MenuImageAdapter extends Bas ...