我是Selenium的新手,想知道是否有人可以指出我正确的方向.
我试图获取页面的页面源,但我注意到IE驱动程序返回的内容与FirefoxDriver不同.
此外,InternetExplorerDriver.getPageSource()返回的字符串与我在IE上单击视图页面源时看到的字符串不同.
我正在运行IE 8和Firefox 22.
有关此页面上的示例: http://stackoverflow.com/questions/16455217/webdriver-save-the-location-of-the-id-in-the-page
当我调用getPageSource()时,IE返回了这样的东西.
"<HTML><HEAD><TITLE>selenium - Webdriver / Save the location of the ID in the page - Stack Overflow</TITLE><LINK rel="shortcut icon" href="https://cdn.sstatic.net/stackoverflow/img/favicon.ico"><LINK rel="apple-touch-icon image_src" href="https://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
Run Code Online (Sandbox Code Playgroud)
虽然Firefox归还了这个.
"<!DOCTYPE html>
Run Code Online (Sandbox Code Playgroud)
<title>selenium - Webdriver / Save the location of the ID in the page - Stack Overflow</title>
<link href="https://cdn.sstatic.net/stackoverflow/img/favicon.ico" rel="shortcut icon" />
<link href="https://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png" rel="apple-touch-icon image_src" />
Run Code Online (Sandbox Code Playgroud)
IEDriver是否有办法以与FirefoxDriver相同的方式返回pageSource?