How to get HTML code of a WebElement in Selenium
2016-09-01 09:39
661 查看
http://stackoverflow.com/questions/32234205/how-to-get-html-code-of-a-webelement-in-selenium
WebElementwantele=findwebele.findElement(By.cssSelector("div.row.row-2.title"));
WebElementwantele=findwebele.findElement(By.cssSelector("div.row.row-2.title"));
System.out.println("点击");
wantele=findwebele.findElement(By.cssSelector("a"));
//wantele.getAttribute("a[href]")
//wantele.click();
//Thread.sleep(5000);
System.out.println("url:"+wantele.getAttribute("href"));
//wantele.
WebElementwantele=findwebele.findElement(By.cssSelector("div.row.row-2.title"));
webElement.getAttribute("href"); webElement.getAttribute("class");
Strings=we.getAttribute("outerHTML");
webElement.getAttribute("innerHTML");
WebElementwantele=findwebele.findElement(By.cssSelector("div.row.row-2.title"));
System.out.println("点击");
wantele=findwebele.findElement(By.cssSelector("a"));
//wantele.getAttribute("a[href]")
//wantele.click();
//Thread.sleep(5000);
System.out.println("url:"+wantele.getAttribute("href"));
//wantele.
相关文章推荐
- How to get the HTML source of a webpage in Ruby
- How to get browser name, version and operating system detail in selenium 2(Web driver)
- How to get the content of the 'identity' section in web.config
- Re: How to use values of properties file in selenium code - msg#02103
- How to get request_id of previous request in a request set?
- how to know wether an element is exist in a html page.
- How to get an icon of an object in Windchill
- How to put a space character before option text in a HTML select element?
- How to get Intellisense for Web.config and App.config in Visual Studio .NET?(转载)
- How can selenium web driver get to know when the new window has opened and then resume its execution
- JS:Trim() in javascript, how to define a function of checkinput for a WebControl(ascx)
- How can I get the IPv4 address of an interface in linux from C code ?
- How to get IOleSite interface of the WebBrowser in an ActiveX control
- How to get html text in a Flex Alert panel.
- How to get the query statement of LOV in Oracle Form
- How to get height of hidden element?
- SQL: How to get a series of dates in sql using connect by
- How to get the size of file in C++ - 在C++中如何获取文件的大小
- All-In-One Code Framework(AIO): 如何使用C#编写进程外的COM组件 (How to write an out-of-proc COM server in C#)
- How to get control of your time and your life (Alan Lakein.)