from selenium import webdriver
import time fireFoxOptions = webdriver.FirefoxOptions()
fireFoxOptions.set_headless()
driver = webdriver.Firefox(firefox_options=fireFoxOptions) driver.get('https://www.baidu.com/?tn=93380420_hao_pg')
driver.find_element_by_id('kw').send_keys('测试')
time.sleep(3)
driver.get_screenshot_as_file(r"C:\Users\wecash\Desktop\baidu.png")

  

selenium-firefox-headless的更多相关文章

  1. ubuntu服务器端使用无界面selenium+ chrome + headless

    本来想直接用Ubuntu系统里面的firefox来实现selenium自动操作签到的,但是总是出各种问题.没办法,改为Chrome.参考:Ubuntu 线上无界面服务器 使用selenium chro ...

  2. Selenium2学习-038-firefox、webdriver版本不对称问题解决:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055

    今天有个朋友在群里问,为何脚本运行不通过,其脚本操作步骤简单描述如下: 1.启动火狐浏览器 2.打开百度 3.查询框输入关键字 4.点击按钮[百度一下] 脚本挺简单的,其给出的应用报错信息如下所示: ...

  3. WebDriver:org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms

    今天尝试最新的webDriver与fireFox搭配: 运行代码时出现如下的问题,但是浏览器却可以打开: org.openqa.selenium.firefox.NotConnectedExcepti ...

  4. TestNG:org.openqa.selenium.firefox.NotConnectedException: Unable to connect

    http://blog.sina.com.cn/s/blog_68f262210102vgzj.html 今天在尝试着用TestNG写一下自动化测试用例,以前也写过,不过用的是经常封装的代码,现在完全 ...

  5. selenium + firefox/chrome/phantomjs登陆之模拟点击

    登陆之模拟点击 工具:python/java + selenium + firefox/chrome/phantomjs (1)windows开发环境搭建 默认已经安装好了firefox 安装pip ...

  6. 使用Selenium+firefox抓取网页指定firefox_profile后的问题

    from: https://blog.csdn.net/chufazhe/article/details/51145834 摘要:在使用selenium和firefox抓取网页指定firefox_pr ...

  7. Centos 7.6 安装selenium+firefox+google chrome(支持xshell运行)

    1. 查看Linux 版本 [root@penguin selenium]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) ...

  8. Selenium Firefox 官方Webdriver -- Geckodriver 下载地址

    Selenium Firefox 官方Webdriver -- Geckodriver 下载地址 https://github.com/mozilla/geckodriver/releases

  9. 笔记-selenium+chrome headless

    笔记-selenium+chrome headless 1.      selenium+chrome headless phantomjs与selenium分手了,建议使用其它无头浏览器. chro ...

  10. Java+selenium+Firefox/ IE/ Chrome主流浏览器自动化环境搭建

    一.java+selenium+firefox 1.环境准备:JDK1.8 2.安装firefox浏览器v59 3.下载驱动:https://github.com/mozilla/geckodrive ...

随机推荐

  1. HDU1712:ACboy needs your help(分组背包模板)

    http://acm.hdu.edu.cn/showproblem.php?pid=1712 Problem Description ACboy has N courses this term, an ...

  2. selenium python 启动Chrome

    启动Chrom浏览器 下载chromedriver: http://chromedriver.storage.googleapis.com/index.html 当时找chromedriver与chr ...

  3. 安恒X计划12月月赛

    ezweb 主要是序列化问题.没有PHP环境,在线运行的.实例化对象之后修改一下file.然后echo输出序列化的结果.不过下面有一个正则检查.数字前加一个+,影响了正则的匹配,但是对于序列化的还原没 ...

  4. [LeetCode]94, 144, 145 Binary Tree InOrder, PreOrder, PostOrder Traversal_Medium

    Given a binary tree, return the inorder, preorder, postorder traversal of its nodes' values. Example ...

  5. svg绘图工具raphael.js的使用

    1.raphael.js svg画图的开源库,支持IE8+ 官方api: http://dmitrybaranovskiy.github.io/raphael/reference.html Githu ...

  6. Linux系统——PXE高效能批量网络装机

    PXE:Pre-boot Excution Environment,预启动执行环境,石油Intel公司开发的网络引导技术,工作在Client.Server模式,允许客户机通过网络从远程服务器下载阴道镜 ...

  7. Filter—过滤器

    过滤器的作用是什么? 1.拦截传入的请求和传出的响应,能拿到请求和响应中的数据 2.监视,修改,或处理正在客户端和服务器之间交换的数据流 3.利用过滤器的执行时机,实现Web程序的预处理,和后期的处 ...

  8. 《Bilateral Multi-Perspective Matching for Natural Language Sentences》(句子匹配)

    问题: Natural language sentence matching (NLSM),自然语言句子匹配,是指比较两个句子并判断句子间关系,是许多任务的一项基本技术.针对NLSM任务,目前有两种流 ...

  9. TensorFlow中的变量命名以及命名空间.

    What: 在Tensorflow中, 为了区别不同的变量(例如TensorBoard显示中), 会需要命名空间对不同的变量进行命名. 其中常用的两个函数为: tf.variable_scope, t ...

  10. Java获取配置文件跟路径

    一直以为使用new File(相对路径)可以读取class目录下的文件,其实不然.网上查询了一些资料,弄清楚了原理,总结如下: package com.coshaho.learn; import ja ...