【发布时间】:2016-07-27 14:14:57
【问题描述】:
尝试在 youtube 中使用 java 中的 selenium webdriver 自动执行视频时出现以下错误。
我已从以下链接复制代码以实现自动化。
以下是我遇到的错误
线程“主”org.openqa.selenium.WebDriverException 中的异常:document.movie_player 未定义 命令持续时间或超时:23 毫秒 构建信息:版本:'2.46.0',修订:'87c69e2',时间:'2015-06-04 16:17:10' 系统信息:主机:'HYDPCM99232L',ip:'10.1.1.3',os.name:'Windows 7',os.arch:'x86',os.version:'6.1',java.version:'1.7.0_79 ' 会话 ID:a573f5f2-29c4-4b62-a5f2-54e44a762547 驱动信息:org.openqa.selenium.firefox.FirefoxDriver 功能 [{platform=WINDOWS,acceptSslCerts=true,javascriptEnabled=true,cssSelectorsEnabled=true,databaseEnabled=true,browserName=firefox,handlesAlerts=true,nativeEvents=false,webStorageEnabled=true,rotatable=false,locationContextEnabled=true,applicationCacheEnabled=true ,需要屏幕截图=true,版本=40.0.2}] 在 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 在 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 在 java.lang.reflect.Constructor.newInstance(Constructor.java:526) 在 org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204) 在 org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156) 在 org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605) 在 org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:514) 在 FlexWebDriver.callFlashObject(FlexWebDriver.java:23) 在 Youtube.main(Youtube.java:17) 原因:org.openqa.selenium.WebDriverException:document.movie_player 未定义 构建信息:版本:'2.46.0',修订:'87c69e2',时间:'2015-06-04 16:17:10' 系统信息:主机:'HYDPCM99232L',ip:'10.1.1.3',os.name:'Windows 7',os.arch:'x86',os.version:'6.1',java.version:'1.7.0_79 ' 驱动程序信息:驱动程序版本:未知 在 .anonymous(.....youtube 链接...)
我是否缺少任何要安装/配置来自动化 youtube 视频的东西? 这两天让我发疯了。
【问题讨论】:
-
这个问题解决了吗?
-
是的...我解决了这个问题...谢谢
-
你是怎么做到的?请回答您的问题。
-
我已经解决了问题,代码看起来像
标签: youtube automation