我是 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">
虽然 Firefox 返回了这个。
"<!DOCTYPE html>
<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" />
IEDriver 有没有办法以与 FirefoxDriver 相同的方式返回 pageSource?