0

How can I find Color Of The Day: in a html document from the web? And then find the text AFTER it like this:

Color Of The Day: Blue

The HTML ( Cropped Line ) looks like this:

<li><strong>Color Of The Day: Blue</strong></li>

The web's source has a lot of lines up and down.

I'm looking for a way to put Blue in a MsgBox(color)

Thanks for reading.

  • 1
    Welcome to Stack Overflow! Please go through the [tour](http://stackoverflow.com/tour), the [help center](http://stackoverflow.com/help) and the [how to ask a good question](http://stackoverflow.com/help/how-to-ask) sections to see how this site works and to help you improve your current and future questions, which can help you get better answers. – help-info.de Jul 01 '16 at 15:11
  • Possible duplicate of: http://stackoverflow.com/questions/5818116/how-to-get-the-source-code-of-a-html-page-using-vb-net – help-info.de Jul 01 '16 at 15:12
  • in combination with: http://stackoverflow.com/questions/516811/how-do-you-parse-an-html-in-vb-net – help-info.de Jul 01 '16 at 15:14
  • Please try searching by Google or StackOverflow before asking here! – help-info.de Jul 01 '16 at 15:15
  • Please include the failed examples you've tried so far, along with any error messages and error codes. – agc Jul 01 '16 at 18:15

1 Answers1

0

First read in the whole string into a variable as normal. Then use the Replace function to get rid of the part you don't want.

Example:

Let's say you read in and saved the string

"Color Of The Day: Blue" to a variable called withParts

Dim withoutParts As String = Replace(withParts, "Color Of The Day: ", "")

This will replace the phrase "Color Of The Day: " with nothing, essentially giving you a new string" "Blue" in your new variable withoutParts

MacedonZero
  • 216
  • 1
  • 9