【发布时间】:2011-12-07 20:30:25
【问题描述】:
我正在尝试使用可在 selenium 中使用的 xpath/css 表达式从以下锚标记中提取/存储 href 属性。能不能给点灯。
<a href="http://domain/bang?a=3681fd26e8c48c2a&vg=e1a15b4b-ad83-4b2b-5704-364d06783bc8&pti=9&pa=content&hpi=775&astn1=Popular&rti=2&u=&1uguid1=19c01b00-ad83-4b2b-3832-674ce2bc1be3&s=206A-0A68-603D-F35D-06C61CFAE18E&pg=-1&p=10215323&ct=http%3A%2F%2Fwww.xyz.com%2FBass-Pro-Shops-The-Hunt-Trophy-Showdown-Video-Game-for-Wii%2Fproduct%2F10215323%2F230625%3FcmCat%3DCROSSSELL_HOMEPAGE">Bass Pro Shops® The Hunt Trophy...</a>
【问题讨论】:
-
你的问题到底是什么?
-
我正在尝试创建 xpath,它允许我将此链接存储到 java 中的某个局部变量中
-
不是每个基本的“Java 中的 xpath”教程都涵盖了这一点吗?认为选择
<a>元素是一项极其微不足道的任务?
标签: java xpath selenium css-selectors