Is it possible to get an outside page html source from inside HandleURL? I see many posts explaining usage of HTMLViewer to extract HTML, but how can I do it from “App.HandleURL”?
i think you would sub class a TCPSocket or SSLSocket
then make a request there and wait for the response.
this object must be outside of a method scope because it is asynchronous.
URLConnection to get html source from a webpage/site
Keep in mind that neither of these solutions will run the JavaScript on the page and you will not have what you’d have with a browser or HTMLViewer.
@DerkJ URLConnection did work in my computer, but when deployed I receive the following error:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request [GET /http:/www.google.com].
Reason: Error reading from remote server
Do you have any idea that could help me? I couldn’t find anything else here in forum
So this does not work?
Var con As New URLConnection
Var content As String = con.SendSync("GET", "http://testing.com", 60)
If con.content <> "" Then
// does this work ?
End If
Make sure you test if .sendSync is not blocking the whole web app, i guess it’s threaded and will yield but i’m not sure about it.
I thank you.