一.具体代码实现:

from selenium import webdriver

driver = webdriver.Firefox()
driver.get('https://www.douban.com/') driver.find_element_by_id('form_email').clear()
driver.find_element_by_id('form_email').send_keys('XXX')
driver.find_element_by_id('form_password').clear()
driver.find_element_by_id('form_password').send_keys('XXX')
driver.find_element_by_xpath('//*[@id="lzform"]/fieldset/div[3]/input').click() with open('C://1.html','wb') as file: #读取豆瓣源代码保存到C://1.html
file.write(driver.page_source.encode('UTF-8')) driver.quit()

  

18.Selenium+Python案例 -- 豆瓣的更多相关文章

  1. 11.Selenium+Python案例--百度

    一.具体代码实现 from selenium import webdriver from selenium.webdriver.common.action_chains import ActionCh ...

  2. 12.Selenium+Python案例 -- 今日头条(获取科技栏目的所有新闻标题)

    一:具体代码实现 # -*- coding: utf-8 -*-# @Time : 2018/7/26 16:33# @Author : Nancy# @Email : NancyWangDL@163 ...

  3. 案例学python——案例三:豆瓣电影信息入库

    闲扯皮 昨晚给高中的妹妹微信讲题,函数题,小姑娘都十二点了还迷迷糊糊.今天凌晨三点多,被连续的警报声给惊醒了,以为上海拉了防空警报,难不成地震,空袭?难道是楼下那个车主车子被堵了,长按喇叭?开窗看看, ...

  4. selenium模拟登录豆瓣和qq空间

    selenium模拟登录豆瓣和qq空间今天又重新学习了下selenium,模拟登录豆瓣,发现设置等待时间真的是很重要的一步,不然一直报错:selenium.common.exceptions.NoSu ...

  5. <译>Selenium Python Bindings 2 - Getting Started

    Simple Usage如果你已经安装了Selenium Python,你可以通过Python这样使用: #coding=gbk ''' Created on 2014年5月6日 @author: u ...

  6. selenium+python自动化测试

    F12: 右键   选择复制  path 在selenium+python自动化测试(一)–环境搭建中,运行了一个测试脚本,脚本内容如下: from selenium import webdriver ...

  7. python爬虫积累(一)--------selenium+python+PhantomJS的使用(转)

    阅读目录 一.Selenium介绍 二.爬虫为什么要用selenium? 三.PhantomJS介绍 四.PhantomJS安装 五.操作实战 六.在此推荐虫师博客的学习资料 selenium + p ...

  8. Python爬虫个人记录(四)利用Python在豆瓣上写一篇日记

    涉及关键词:requests库 requests.post方法 cookies登陆 version 1.5(附录):使用post方法登陆豆瓣,成功! 缺点:无法获得登陆成功后的cookie,要使用js ...

  9. selenium+python自动化79-文件下载(SendKeys)

    前言 文件下载时候会弹出一个下载选项框,这个弹框是定位不到的,有些元素注定定位不到也没关系,就当没有鼠标,我们可以通过键盘的快捷键完成操作. SendKeys库是专业的处理键盘事件的,所以这里需要用S ...

随机推荐

  1. IE开发人员工具手册

    The DOM Explorer tool (CTRL + 1) The The DOM Explorer tool shows the structure of your webpage as it ...

  2. 关于使用UniForm以其他控件为Parent时应该注意的问题

    关于使用UniForm以其他控件为Parent时应该注意的问题: 1,不能在其他组件的oncreate,onbeforeshow,onshow等事件中来生成这样的uniform,否则其上的组件不能显示 ...

  3. hive 数据清理--数据去重

    hive> select * from (select *,row_number() over (partition by id) num from t_link) t where t.num= ...

  4. easyui扩展数据表格点击加号拓展

    $(function(){ $("#RepaymentInfoTab").datagrid({ view: detailview, detailFormatter:function ...

  5. scala学习手记9 - =和==

    = 赋值运算 scala的赋值运算和java的有着很大的不同.如a=b这样的赋值运算,在Java中返回值是a的值,在scala中返回的则是Unit(Unit是值类型,全局只存在唯一的值,即(),通常U ...

  6. tensorflow conv2d的padding解释以及参数解释

    1.padding的方式: 说明: 1.摘录自http://stackoverflow.com/questions/37674306/what-is-the-difference-between-sa ...

  7. mysql数据库优化课程---7、网站的搜索技术怎么选

    mysql数据库优化课程---7.网站的搜索技术怎么选 一.总结 一句话总结: 1.量很小(像小网站)---like2.量大一点()---标签3.量超级大(像百度)---搜索引擎 1.数据库中取一列比 ...

  8. 【Demo】CSS图像拼合技术

    图像拼合 图像拼合 - 简单实例 <style> img.home { width: 46px; height: 44px; background: url(/images/img_nav ...

  9. 获得Ztree选择的节点

    $('#save').click(function(){ if($("#roleForm").form("validate")){ var treeObj = ...

  10. smarty语法

    HTML中直接显示数据 <{$data}> foreach循环 <{foreach from=$data item=item key=key}> <li data-ind ...