int traverse_and_calculate(const vector< vector<int> > &board, int start_row, int start_column, int inc_row, int inc_col, int length)
{
for (int row = start_row, column = start_column, step = 0; step < length; row += inc_row, col += inc_col)
{
}
}
我想使用jsoup读取值Rs.999。 我的代码是
<div style="float:left;width:100%">
<span class="scratchPrice" style="font-size:12px;font-weight:normal; color :#999999"><del>Rs 2999</del> </span>
<span class="discountPrice" style="font-size:12px;font-weight:normal;color: #f5615f">(66% off)</span>
<span style="font-size:16px;font-weight:bold;color:#5a5a5a;width:100%;float:left;">Rs 999 </span>
</div>
并使用此代码我获得了价值(66%的折扣) 请看一下这段代码。 感谢你..
答案 0 :(得分:0)
您将获得以下每个跨度,并检查其最后一个跨度。
Document doc;
Element div;
Elements span;
div = doc.select("div").get(0); // select the first div.
span = div.select("span");
for (int i = 0; i < span.size(); i++) {
Element span = span.get(i);
//check here is its last span from div than extract this value will return RS.999
}
答案 1 :(得分:0)
使用此CSS查询:
span.scratchPrice > del
Element del = document.select("span.scratchPrice > del").first();
System.out.println(del.text());