HTML Sources

  1. 4 months ago

    Kevin C

    Mar 11 Saskatoon, Saskatchewan Canada

    i was wondering if there was a method to read structured data from a html webpage source.

    I would like to get each value from the price column from this webpage

    https://info.binance.com/

    dim rx as new RegEx
    rx.SearchPattern = "(?mi-Us)symbolNum two"" data-value=""(.+)"""
    
    dim rxOptions as RegExOptions = rx.Options
    rxOptions.LineEndType = 4
    
    dim match as RegExMatch = rx.Search( sourceText )
  2. Beatrix W

    Mar 11 Pre-Release Testers Europe (Germany)

    Sure, you can do this. The question is: should you? Typically, this type of data has an API that you can access. And you need to check if you can access the data for free or if it costs money.

  3. Jean-Yves P

    Mar 12 Pre-Release Testers, Xojo Pro Answer Europe (France, Besancon)
    dim rx as new RegEx
    rx.SearchPattern = "(?mi-Us)symbolNum two"" data-value=""(.+)"""
    
    dim rxOptions as RegExOptions = rx.Options
    rxOptions.LineEndType = 4
    
    dim match as RegExMatch = rx.Search( sourceText )
  4. shao s

    Mar 12 Pre-Release Testers Sudbury, Ontario, Canada

    https://github.com/binance-exchange/binance-official-api-docs

  5. Kevin C

    Mar 12 Saskatoon, Saskatchewan Canada

    @Beatrix W Sure, you can do this. The question is: should you? Typically, this type of data has an API that you can access. And you need to check if you can access the data for free or if it costs money.

    I beleive this page is free for the next 30 days then I will have to pay for it.

  6. Kevin C

    Mar 12 Saskatoon, Saskatchewan Canada

    Dim secureSite As New HTTPSecureSocket
    secureSite.Secure = True
    secureSite.ConnectionType = SSLSocket.TLSv12
    Dim Page As String = secureSite.Get("https://info.binance.com/en/currencies/litecoin", 30)
    // Get the current Binance price for LiteCoin

    dim rx as new RegEx
    rx.SearchPattern = "(?mi-Us)symbolNum three"" data-value=""(.+)"""
    dim rxOptions as RegExOptions = rx.Options
    rxOptions.LineEndType = 4

    dim match as RegExMatch = rx.Search( Page )

    If Match <> Nil Then
    Label1.Text = Match.SubExpressionString(1)
    Else
    Label1.Text = "not found!"
    End If

or Sign Up to reply!