【发布时间】:2014-06-05 22:07:58
【问题描述】:
我正在尝试从一个充满 div 的文本文件中获取特定的 div。 我正在使用 streamreader 进入文件,但我不知道如何获取完整的 div。 得到 div 后,我将把每一行变成一个字符串,然后添加到一个列表中。 文本文件如下:
<div id="#SMINLANGUAGE1 ">
English
Hello.
This is a Test
Test 23
</div>
<div id="#SMINLANGUAGE2 ">
Dutch
Hallo.
Dit is een Test
Test 29
</div>
<div id="#SMINLANGUAGE3 ">
Spanish
Hola.
Esto es una Prueba.
Prueba 86
</div>
英文列表为:
Index 0: English
Index 1: Hello.
Index 2: This is a Test
Index 3: Test23
【问题讨论】:
-
我已使用 CsQuery 来完成此操作。见stackoverflow.com/questions/22092208/parsing-html-with-csquery
标签: c# html text-files streamreader