locked
HTMLDocument RRS feed

  • Question

  • I'm having an issue parsing a string, in the line "If DocStr.Contains("<td>" & CStr(FirstCardNum) & ".</td>") Then" below, it returns zero, the issue is that I put a breakpoint there and looked at the string in QuickWatch and it was in there, i've narrowed down that its not the String.Contains function because it works elsewhere, even with identical data. That leads me to believe that it has something to do with the HTML.Document. Can anybody help?


    Private Function GetCardList() As Boolean
            Dim FirstCardNum As Integer = 1
            Dim ListDoc As HtmlDocument
            Dim DocStr As String
            Dim EOL As Boolean = False
            Dim CA As Array

            Try
                Do While EOL = False
                    Dim WB As New WebBrowserDiag("http://gatherer.wizards.com/", "?first=" & FirstCardNum & "&last=" & FirstCardNum + 2 & "&term=&setfilter=Allsets&colorfilter=All&typefilter=All&output=summary&sort=name&x=18&y=29")

                    WB.ShowDialog()
                    ListDoc = WB.Document
                    DocStr = ListDoc.Body.InnerHtml.ToString
                    If DocStr.Contains("<td>" & CStr(FirstCardNum) & ".</td>") Then
                        Dim A As Array = ParseListDoc(DocStr)
                        AU.MergeArrays1D(CA, A)
                        FirstCardNum += 3000
                    Else
                        EOL = True
                    End If
                Loop
                Return True
            Catch ex As Exception
                Return False
            End Try
        End Function

    Sunday, December 11, 2005 5:51 AM

All replies