下面的代码返回span变量的“ H”值,但我正在寻找它来返回23988.00美元的金额。编辑HTML以获得更多范围
search_highprice=[]
result_elements = driver.find_elements_by_xpath('//span[@class="tile_high-label"]')
for element in result_elements:
search_result = element.text
search_highprice.append(search_result)
<div class="tile_high-low pull-left" style="color: rgba(255, 255, 255, 0.67);">
<div>
<span class="tile_high-label">H</span>
23988.00
</div>
<div>
<span class="tile_low-label">L</span>
23535.00
</div>
</div>
答案 0 :(得分:1)
美元金额包含在div中,因此您必须定位该元素。
# A tibble: 4 x 4
Group Fixed Variable GrandTotal
<chr> <dbl> <dbl> <dbl>
1 A 1100 700 1800
2 B 600 500 1100
3 C 450 350 800
4 NA 2150 1550 3700