我正在尝试从 twitter 页面读取值。页面源如下所示
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">
<title>Twitter / Authorize an application</title>
...........
<div id="bd" role="main">
<p class="action-information">You've granted access to yourapp!</p>
<div id="oauth_pin">
<p>
<span id="code-desc">Next, return to yourapp and enter this PIN to complete the authorization process:</span>
<kbd aria-labelledby="code-desc"><code>58643144</code></kbd>
</p>
</div>
</div>
..............
</body>
</html>
我正在尝试将“PIN”的值输入到我的 C# winform 应用程序中。意思是下一行中代码标记之间的值
<kbd aria-labelledby="code-desc"><code>58643144</code></kbd>
我已经尝试了下面的代码。但这不起作用,因为 PIN 包含在 div 标签中并且没有 id。请帮助从 html 网页获取 PIN 的值。谢谢
string verifier = browser.TextField(Find.ById("code-desc")).Value