Search code examples
vb.net.net-3.5webbrowser-control

WebBrowser getting error while navigate to url


I'm trying to create a web scraper to programmatically search and display shipment information from GLS website. I used the same function with another shipment company's site without getting any issue.

The problem is, when the WebBrowser1.Navigate(URL) is called, it returns a blank html page.

This is the error: WebBrowser error

Translation: "Web page exploration cancelled"

This is my code:

Private Function SearchShipment(ByVal indexCodiceSpedizione As Integer) As Boolean
    Try
        WebBrowser1.Navigate("https://www.gls-italy.com/it/servizi-per-destinatari/ricerca-spedizione")
        'I got the error here
        WaitForPageLoad()
        'Stuff to insert shipment code inside the website and search for infos
        Return True
    Catch ex As Exception
        Return False
    End Try
End Function

N.B. The WebBrowser1 gave me the same error also on "www.gls-italy.com" but it works perfectly with other websites.


Solution

  • In the end I figured out that on .NET 3.5 the WebBrowser isn't able to run PHP, asp.net and JS. So for me at the moment there isn't any possible solution.