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:

MillionRoses 引用 删除 dian106106   /   2012-05-17 14:49:42
String str = "http://in.msn.com/?rd=1&ucc=IN&dcc=IN&opt=0&pc=msnHomeST&ar=1";
          String[] s = str.split("&");
          
          for(int i=0;i<s.length;i++){
                  System.out.println(s[i]);
          }
 

评分:0

我来说两句

日历

« 2024-05-14  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 74701
  • 日志数: 80
  • 建立时间: 2012-04-12
  • 更新时间: 2013-05-21

RSS订阅

Open Toolbar