Cannot webdriver.get(url) an IP address in Selenium 3
<p>So I wrote a python script that uses Selenium 2 to do various things to my modem. This fully works. </p>

<p>I am now busy updating the script to use Selenium 3, but I immediately ran into a problem where I cannot even get to the login page of the modem. The problem seems to be with the <code>get()</code>.</p>

<p>First of all it now crashes when given a fake URL. I then gave it the Google URL and it works perfectly, but now I need to go to the modem's IP. But when I use <code>driver.get(_rout_ip)</code>, where <code>_rout_ip</code> is <strong>10.0.0.2</strong>, it just appends the IP address to the Google URL. Removing the <code>get</code> for the fake URL is not an option since for some reason it is required as it cannot directly go to the modem ip.</p>

<p>The code for getting the webdriver instance is below </p>

<pre><code>def get_driver():
    """
    Get an instance of a webdriver that is initialized to the router login page
    :return: A webdriver instance
    """

    if not os.path.exists(os.getcwd() + '\\' + _driver_name):
        print('ERROR: The specified driver does not exist, %s' % (os.getcwd() + '\\' + _driver_name))
        exit()

    print "Initializing the webdriver"

    # Set the path to the driver to be used
    os.environ["webdriver.gecko.driver"] = os.getcwd() + '\\' + _driver_name

    driver = webdriver.Firefox()

    # Go to a fake website. This is needed since it cannot go to the modem directly for some reason
    try:
        driver.get('http://poop_smells_nice.com')
    except Exception:
        print('WOOT')

    waiter.sleep(_SLEEP_TIME)  # Pause a bit to be safe

    print "Switching to the router login page"

    # Go to the modem ip
    driver.get(_rout_ip)

    driver.switch_to.default_content()
    return driver
</code></pre>

<p>Does anyone have any idea why this is happening?</p>

<p><code>10.0.0.2</code> is not a URL and so the browser falls back on searching for it. Try <code>http://10.0.0.2/</code></p>

python selenium firefox selenium-webdriver