I am having trouble with a screen scrape using regular expressions. Here's the html:
<div id="container" class=" narrowContainer" >
<nav id="sitenav" class="">
<div class="noSubNav"></div>
</nav>
<div id="content" class="allGroups">
<div id="contentHead">
<div class="groupNav">
<a href="/community">Community</a> / Public Groups
</div>
</div>
<div id="contentBody" class="clearfix">
<div id="publicGroups">
<div class="section groups">
<ul class="groupList">
<li class="groupItem">
<a class="groupName" href="/group/22BGNF">
!Test
</a>
<span class="totalMembers">2 members</span>
<p class="description">
</p>
</li>
Here's my latest attempt. I need to loop through all of the groups, but for now, I am just trying to get the first one.
I don't get the "No data" message, but the only thing written to the console is "The thread '<No Name>' (0x36c0) has exited with code 0 (0x0). "
I have also tried using LINQ.
Thanks for any suggestions!
<div id="container" class=" narrowContainer" >
<nav id="sitenav" class="">
<div class="noSubNav"></div>
</nav>
<div id="content" class="allGroups">
<div id="contentHead">
<div class="groupNav">
<a href="/community">Community</a> / Public Groups
</div>
</div>
<div id="contentBody" class="clearfix">
<div id="publicGroups">
<div class="section groups">
<ul class="groupList">
<li class="groupItem">
<a class="groupName" href="/group/22BGNF">
!Test
</a>
<span class="totalMembers">2 members</span>
<p class="description">
</p>
</li>
Here's my latest attempt. I need to loop through all of the groups, but for now, I am just trying to get the first one.
Code:
Public Sub ParseGroup(html As String)
Dim source = "<div id=""container"" class="" narrowContainer"" >" & "<div id=""content"" class=""allGroups"">" _
& "<div id=""contentBody"" class ""clearfix"">" & "<div id=""publicGroups"">" & _
"<div class=""section groups"">" & "<ul class=""groupList"">" _
& "<li class=""groupItem\"">" & "</li>"
'group record
Dim pattern = "<ul class=""groupList"">"
Dim rgx = New Regex(pattern, RegexOptions.IgnoreCase)
Dim match = rgx.Match(source)
If match.Success Then
Dim data = match.Groups("data")
Console.WriteLine(data.Value)
Else
TextBox2.Text = "No data"
End If
End Sub
I have also tried using LINQ.
Thanks for any suggestions!