如何在python中使用硒设置HTMLUnit驱动程序? [英] How to set up HTMLUnit Driver with selenium in python?

查看:84
本文介绍了如何在python中使用硒设置HTMLUnit驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里阅读答案使我理解,因为HTMLUnit是用Java实现的,所以我需要连接到Selenium Java服务器.我真的不太明白这意味着什么,如果有人将我指向正确的方向,我将不胜感激.

Reading the answers on here has led me to understand that I need to connect to the Selenium Java server because HTMLUnit is implemented in java. I don't really understand what this means and would appreciate if someone would point me in the right direction.

推荐答案

使用硒中内置的低于2.52的硒罐

use the selenium jar below 2.52 which come inbuilt in the selenium

from selenium import webdriver
driver = webdriver.Remote(
desired_capabilities=webdriver.DesiredCapabilities.HTMLUNIT)
driver.get('https://stackoverflow.com/')

2.53以上的版本,您必须单独下载 HTMLdriver

above 2.53 you have to download the HTMLdriver separately

有关更多信息,请访问以下

For more information visit this Link

这篇关于如何在python中使用硒设置HTMLUnit驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆