google-chrome - Chrome 用 selenium 打开 "Data;"

标签 google-chrome selenium selenium-webdriver google-chrome-devtools ui-automation

我是 Selenium 的新手,尝试通过 selenium 驱动程序从 Chrome 打开 localhost:3000 页面。 代码是:

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("localhost:3000");
    }

}

但是,这会打开我的 chrome 窗口,并显示“数据;” 。 Chrome版本为50.0.2661.94

知道确切的问题是什么吗?

最佳答案

指定您正在使用的协议(protocol),因此不要使用 localhost:3000,而是使用 http://localhost:3000。如果这没有帮助,请参阅评论 here在 Chromium 问题跟踪器上。

关于google-chrome - Chrome 用 selenium 打开 "Data;",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37159684/

相关文章:

javascript - 动态图像加载谷歌浏览器

python - 使用 Python 的 headless-selenium-for-win

django - Selenium 测试在各个测试之间非常慢

python - Selenium 中的旋转代理

python - 在 Selenium 中打开之前设置 chromedriver 窗口大小(python)

google-chrome - chrome.webNavigation.onTabReplaced 不触发

javascript - chrome.scripting.executeScript - 意外属性 : 'arguments'

python - Selenium 和 BeautifulSoup : sharing and pulling session data resources to multiple libraries in python

c# - 如何使用 Selenium WebDriver 滚动到元素

javascript - Chrome 开发者工具中缺少文件夹