Retrieve HtmlElement
本文关键字:HtmlElement Retrieve | 更新日期: 2023-09-27 18:31:32
<a href="/game.php?yo=120252&screen=info_command&id=1602691855&type=own">
<span class="element1">
Random text
</span>
我正在使用带有集成Web浏览器的Windows-Forms-Application。有没有办法检索这个特定的HtmlElement?
对不起,我是新手,如果缺少一些信息,请告诉我。
using System.Linq;
...
var element1 = browser.Document.GetElementsByTagName("span")
.Where(e => e.GetAttribute("class") == "element1")
.FirstOrDefault();
如果没有找到element1
,将null