Answer the question
In order to leave comments, you need to log in
How can the IndexOf method (from the .NET framework) explain that inside the method's brackets, any text can be placed between some HTML tags?
Hello.
I am extracting data from the HTML code of some web page. And I'm doing this with Visual Basic and the .NET framework.
To get data from the HTML code, I use the IndexOf method, and when using it, inside the method brackets, there may be different HTML code, or this:
i = СТРОКА.IndexOf("<td><strong><a id="iraq" href="некоторая_ссылка">Ирак</a></strong></td>")
i = СТРОКА.IndexOf("<td><strong>Сербия</strong></td>")
<td><strong>
</strong></td>
i = СТРОКА.IndexOf("<td><strong> Здесь располагается любой текст или HTML-код </strong></td>")
Answer the question
In order to leave comments, you need to log in
1. do not use IndexOf for parsing pages
2. or drag data through regular expressions (not the easiest and most reliable way)
3. or take either HtmlAgilityPack ( https://htmlagilitypack.codeplex.com/) and you can pull out anything you want through Xpath.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question