我有一些非常设计的HTML,我试图将数据从中轻松读取。
我可以使用innerHTML
来获取信息,但遗憾的是它出现在一面文字中。
当我“查看源代码”(为隐私而更改的词语)时,来自网页的来源示例是:
<td nowrap valign="top"><b>Logger Notes</b></td>
<td valign="top">Hi,
Person needs a full breakdown Important information.
Would also would like confirmation in a letter about what kinds of assistance
she is not eligible for if possible.
Would prefer sent to email.
Thanks </td>
然而,当我得到数据时,它就像一面文字一样:
Hi, Person needs a full breakdown Important information. Would also would like confirmation in a letter about what kinds of assistance she is not eligible for if possible. Would prefer sent to email. Thanks
这显然更难阅读。
当我使用innerHTML
并查看字符串时,所有换行符都是空格字符,所以我不能使用replace
。
我搜索并尝试了很多不同的东西,但我无法找到一种方法来显示它,因此它很容易阅读。
该网页位于我们的工作内部网上,并且已登录(使用电子表格的多人将使用 - 因此我无法自动执行此操作)
首选输出示例:
Hi,
Person needs a full breakdown Important information.
Would also would like confirmation in a letter about what kinds of assistance she is not eligible for if possible.
Would prefer sent to email.
任何意见,将不胜感激。
也许,在每次出现一段时间后添加一个换行符?
例如,replace
与"."
的"." & vbCrLf