Chrome opens with “Data;” with selenium

后端 未结 9 1365
轻奢々
轻奢々 2020-12-16 10:25

I am a newbie to Selenium and trying to open localhost:3000 page from Chrome via selenium driver. The code is :

import com.google.common.base.Function;
imp         


        
相关标签:
9条回答
  • 2020-12-16 11:16

    Yes it will start with data. After data just try to give the URL.The 'data:,' URL is just the default address that chromedriver navigates to when launching chrome. So this by itself doesn't necessarily mean that anything is going wrong.

    import com.google.common.base.Function;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebDriverException;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    public class SeleniumTests {
    
    public static void main(String[] args) {
    
    
        System.setProperty("webdriver.chrome.driver", "C://chromedriver_win32//chromedriver.exe");
        WebDriver driver = new ChromeDriver();              
        driver.get("https://www.google.co.in/?gfe_rd=cr&ei=KxAzV8-KEJPT8gfT0IWYAw");
    }
    
    }
    

    It will open successfully. Reply if you have any query. Happy Learning.. :-)

    0 讨论(0)
  • 2020-12-16 11:20

    This just happened to me when using selenium grid with python and was caused by something different than the other answers suggest (in my case at least).

    It turns out there was a runtime exception being raised after the driver object was being created (and connecting to chrome) but before it was being instructed to navigate to a URL. This all runs on a celery task queue so it was easy for me to miss. So if updating the chrome driver doesn't work, double check that you're navigating to a URL correctly and there's no errors etc.

    For example:

    driver = webdriver.Remote(
            command_executor="http://<ip>:4444/wd/hub",
        )
    
    # a function here raised a runtime exception, causing chrome to launch
    # but sit there with the default URL "data;/"
    
    driver.get("www.google.com")
    
    0 讨论(0)
  • 2020-12-16 11:24

    I was also getting the same issue. I updated chrome Driver and the issue resolved

    0 讨论(0)
提交回复
热议问题