vba - 在没有任何 id 的 Pre Tag 中获取文本
问题描述
我正在做网页抓取,并想在 vba 中获取 Pre 标记内的文本。但不幸的是,pre 标签没有任何 id。有人可以指导我如何做到这一点
<form method="post" name="statusummary" action="/servstat" id="statserv">
<pre>
....
....
....
</pre>
</form>
解决方案
尝试使用相邻的兄弟组合器将 id 与 pre 标记组合(假设您的缩进是正确的),即位置匹配
ie.document.querySelector("#statserv + pre")
推荐阅读
- php - 如何使用 PHP ldap_modify 更新 Active Directory 中的照片
- react-native - 异步存储错误未处理的承诺拒绝在交换机
- sql-server - 具有不同列数的存储过程 INSERT INTO
- javascript - 如何强制检查表单的复选框?
- python - 从一种形式创建模型实例两次
- xcode - Uitextfield背景颜色模糊?
- android - 如何创建在单击按钮时将语音更改为文本语言的 android 应用程序
- mongodb - 具有多个条件和 id 的 mongodb 聚合查找
- python - 在 Python 3 中处理多个输入变量
- html - 谷歌应用脚本html模板返回空值