getAttribute()&split()
上一篇 /
下一篇 2012-05-17 14:33:13
/ 个人分类:Selenium
String url=driver.findElement(By.xpath(
"//div[@id='headlogo']/img")).getAttribute("src");
String suburl=url.substring(url.length()-4,url.length());
String width=driver.findElement(By.xpath(
"//div[@id='headlogo']/img")).getAttribute("width");
String height=driver.findElement(By.xpath(
"//div[@id='headlogo']/img")).getAttribute("height");
主要是想把split()找个地 放着
String str =
"/Products/eStore/eDetail?uid=68&pid=846 ";
String[] s = str.split(
"pid=");
System.
out.println(s[s.length-1]);
收藏
举报
TAG: