【发布时间】:2018-03-21 22:01:04
【问题描述】:
<div id="ctl00_cphRoblox_rbxGroupFundsPane_GroupFunds" class="StandardBox" style="padding-right:0">
<b>Funds:</b>
<span class="robux" style="margin-left:5px">128</span>
</div>
好的,所以我想获得 128,但有时它会给我“18” 我不知道
我试过了:
dcWeb.SendMessage(s + " = Pending and Robux: " + driver.FindElement(By.ClassName("robux")).GetAttribute("innerHTML"));
和
dcWeb.SendMessage(s + " = Pending and Robux: " + driver.FindElement(By.ClassName("robux")).GetAttribute("textContent"));
【问题讨论】:
-
你为什么不直接使用“.Text”而不是getAttribute
标签: c# html selenium selenium-webdriver