Skip to content

Instantly share code, notes, and snippets.

@karlcow
Created November 7, 2012 11:19
Show Gist options
  • Save karlcow/4030925 to your computer and use it in GitHub Desktop.
Save karlcow/4030925 to your computer and use it in GitHub Desktop.
→ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from selenium import webdriver
>>> webdriver.DesiredCapabilities.OPERA["opera.logging.level"] = "SEVERE"
>>> browser = webdriver.Opera(desired_capabilities=webdriver.DesiredCapabilities.OPERA)
7 nov. 2012 06:11:15 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
06:11:20.659 INFO - Java: Apple Inc. 20.12-b01-434
06:11:20.662 INFO - OS: Mac OS X 10.7.5 x86_64
06:11:20.675 INFO - v2.25.0, with Core v2.25.0. Built from revision 17482
06:11:21.174 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:52976/wd/hub
06:11:21.175 INFO - Version Jetty/5.1.x
06:11:21.176 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
06:11:21.176 INFO - Started HttpContext[/selenium-server,/selenium-server]
06:11:21.177 INFO - Started HttpContext[/,/]
06:11:21.338 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@77f297e7
06:11:21.338 INFO - Started HttpContext[/wd,/wd]
06:11:21.347 INFO - Started SocketListener on 0.0.0.0:52976
06:11:21.348 INFO - Started org.openqa.jetty.jetty.Server@58a17083
06:11:23.437 INFO - Executing: [new session: {platform=ANY, browserName=opera, opera.logging.level=SEVERE, version=}] at URL: /session)
>>> browser.get("http://www.example.com/#hello, world")
>>> browser.current_url
u'http://www.iana.org/domains/example/#hello, world'
>>> browser.get("http://www.example.com/#%c2%a9")
>>> browser.current_url
u'http://www.iana.org/domains/example/#%c2%a9'
>>> browser.get("http://www.example.com/#\ud800\udf00ss")
>>> browser.current_url
u'http://www.iana.org/domains/example/#/ud800/udf00ss'
>>> browser.get("http://www.example.com/#%41%a")
>>> browser.current_url
u'http://www.iana.org/domains/example/#%41%a'
>>> browser.get("http://www.example.com/#\\\ud800\\\u597D")
>>> browser.current_url
u'http://www.iana.org/domains/example/#//ud800//u597D'
>>> browser.get("http://www.example.com/#a\\\uFDD0")
>>> browser.current_url
u'http://www.iana.org/domains/example/#a//uFDD0'
>>> browser.get("http://www.example.com/#asdf#qwer")
>>> browser.current_url
u'http://www.iana.org/domains/example/#asdf#qwer'
>>> browser.get("http://www.example.com/##asdf")
>>> browser.current_url
u'http://www.iana.org/domains/example/##asdf'
>>> browser.get("http://www.example.com/#a\u000Ab\u000Dc\u0009d")
>>> browser.current_url
u'http://www.iana.org/domains/example/#a/u000Ab/u000Dc/u0009d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment