I have a question on extracting from an html page using Regular Expressions. The regex I used is supposed to extract from the span(all 4 of them) but it's not functioning. Please, look at the code I tried and the and the HTML tag I want to extract from.
HTML
<div class="content-wrapper">
<a class="klose"href="https://www.anysiteAtall.com">
<span class="title">The good big book</span>
<span id="place" class="country">America</span>
<span class="price">$300</span>
<span class="color">white</span>
</a>
</div>
MY CODE
Dim span_matchsingle As New Regex(
"<span[^<>]*class=""color""[^<>]*>(?<meTIT>.*?)</span>" & _
"<span[^<>]*class=""title""[^<>]*>(?<destn>.*?)</span>" & _
"<span[^<>]*class=""country""[^<>]*>(?<AtG>.*?)</span>" & _
"<span[^<>]*class=""price""[^<>]*>(?<meVIEW>.*?)</span>")
Dim matches As MatchCollection = span_matchsingle.Matches(Me.TextBox1.Text, RegexOptions.Singleline Or RegexOptions.IgnorePatternWhitespace)
For Each m As Match In matches
Dim actualD As String = m.Groups("meTIT").Value
Dim actss As String = m.Groups("AtG").Value
Dim actunm As String = m.Groups("destn").Value
Dim actualzx As String = m.Groups("meVIEW").Value
'pass them all into the listview
Dim lvi As New ListViewItem
lvi.Text = actualD
lvi.SubItems.Add(actss)
lvi.SubItems.Add(actunm)
lvi.SubItems.Add(actualzx)
Me.ListView1.Items.Add(lvi)
'''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''
Next
This is the code I tried but it did not extract the innertext from span except when I include just one span in the regex and that is not what I want.