EntréePrenez tout le texte HTML avec Html Agility Pack de
<html><body><p>foo <a href='http://www.example.com'>bar</a> baz</p></body></html>
Sortie
foo
bar
baz
Je connais htmldoc.DocumentNode.InnerText
, mais elle donnera foobarbaz
- Je veux chaque texte, pas tout à temps.
Cela a fonctionné avec brio pour moi. Tout ce que je lui ai jeté, même des fragments html merdiques générés par un ancien CMS. – Chris