HelpMinecraft Scraper Tool - VB

Posts 1–3 of 3 · Page 1 of 1
Minecraft Scraper Tool - VB
I would very much appreciate it if someone could help in making a minecraft username scraper.
I'm not new to vb, but I am new to the whole scraping scene.

I have the code written out I could really use help with the regex.

Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

       For i As Integer = 1 To 10
            Dim k As String = "http://mcbans.com/" & i
            Label1.Text = "Usernames Scraped: " & ListBox1.Items.Count
            Dim source As String = New System.Net.WebClient().DownloadString(k)
            Dim reg As Regex
            reg = New Regex("need help here :)")
            Dim Matches As MatchCollection = reg.Matches(source)
            For Each UsernameString As Match In Matches
                Dim s As String = UsernameString.Value.Split(">").GetValue(1)
                Dim z As String = s.Split("<").GetValue(0)
                If IsNumeric(z(0)) Then
                    ListBox1.Items.Add(z)
                End If
            Next
        Next
    End Sub
how regex works:

var = amazing>USERNAME</a>

RegExMatch(var, ">(.*)</a>", id)

id[0]


you set the pattern before and after the username and a "all" (.*) in between

easy peasy
Quote Originally Posted by Jew View Post
how regex works:

var = amazing>USERNAME</a>

RegExMatch(var, ">(.*)</a>", id)

id[0]


you set the pattern before and after the username and a "all" (.*) in between

easy peasy
My problem write not is I got someone teo help me with the regex. But vb doesn't seem to be able to download's the site's string.
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us