셀렌이 HTMLUnit을 사용하도록 어떻게 말합니까?Python에서 Selenium과 HTMLUnit 드라이버를 어떻게 사용합니까?
백그라운드에서 Selenium 서버로 selenium-server-standalone-2.0b1.jar를 실행하고 있고 "pip install -U selenium"으로 설치된 최신 Python 바인딩을 실행 중입니다.
모든 것이 Firefox에서 잘 작동합니다.
>>> import selenium
>>> s = selenium.selenium("localhost", 4444, "*htmlunit", "http://localhost/")
>>> s.start()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/selenium/selenium/selenium.py", line 189, in start
result = self.get_string("getNewBrowserSession", start_args)
File "/usr/local/lib/python2.6/dist-packages/selenium/selenium/selenium.py", line 223, in get_string
result = self.do_command(verb, args)
File "/usr/local/lib/python2.6/dist-packages/selenium/selenium/selenium.py", line 217, in do_command
raise Exception, data
Exception: Failed to start new browser session: Browser not supported: *htmlunit
Supported browsers include:
*firefox
*mock
*firefoxproxy
*pifirefox
*chrome
*iexploreproxy
*iexplore
*firefox3
*safariproxy
*googlechrome
*konqueror
*firefox2
*safari
*piiexplore
*firefoxchrome
*opera
*iehta
*custom
이 그래서 질문의 HtmlUnit과 드라이버가 무엇을
라고 : 그것은 무게 라이터 및이 내 시도가 그렇게하는 것입니다 X를 필요로하지 않는다 그러나 나는, HtmlUnit과를 사용하고 싶습니다? 어떻게 활성화합니까?HTMLUnit 용 코드는 Selenium 2 용 소스에있는 것 같습니다. 그래서 다른 브라우저와 마찬가지로 기본적으로 사용할 수있을 것으로 예상됩니다. 활성화 방법에 대한 지침을 찾을 수 없습니다.
모의 *로 브라우저를 지정하여 HtmlUnitDriver 사용할 수 있어요 나는 Selenium 2 또는 Selenium-RC 중 어느 것을 사용하든 상관하지 않는다. – frabcus
[Selenium과 함께 HtmlUnit 드라이버를 Python 바인딩을 통해 어떻게 사용할 수 있습니까?] (http://stackoverflow.com/questions/4081724/how-do-i-use-the-htmlunit-driver-with-selenium -through-python-bindings) – CraigTeegarden