我有如下的XML,
<div class="storeContainer">
<div class="storeCount">50</div>
<div class="mapAddress" id="store50">
<h4 onclick="changeMap(50,38.872432,-78.530463);">Woodstock, VA</h4>
<h5>Woodstock Square</h5>467 West Reservoir Road
<br/>540-459-7505
<br/>
<a href="https://maps.google.com/maps?saddr=geo&daddr=467+West+Reservoir+Road+Woodstock+VA+22664&sll=38.872432,-78.530463&sspn=0.011265,0.014098&z=12"
class="getDirections">Get Directions</a>
</div>
</div>
</div>
我想阅读地址详情并使用
def envelope = new XmlSlurper().parseText(response.toString());
envelope.'**'
.each {
println it.h4.text()
println it.h5.text()
println it.a.@'href'
}
获取价值,但我不知道如何获得 467 West Reservoir Road 和 540-459-7505
答案 0 :(得分:1)
如果您切换到.left:after {
background-color:lightblue;
left: -999em;
content: '';
display: block;
position: absolute;
width: 999em;
top: 0;
bottom: 0;
}
.right:after {
background-color:#4444ff;
right: -999em;
content: '';
display: block;
position: absolute;
width: 999em;
top: 0;
bottom: 0;
}
,则可以执行以下操作:
XmlParser