Hello you guys!
I want to visit a website, toggle a login via jscript and then grab the whole html code of the page.
My first tries where using the WebBrowser control (IE) of VB.Net.
Dim oStream As Stream
Dim oStreamReader As StreamReader
Dim hReq As HttpWebRequest
Dim hRes As HttpWebResponse
hReq = DirectCast(HttpWebRequest.Create(sURL), HttpWebRequest)
hRes = DirectCast(hReq.GetResponse(), HttpWebResponse)
oStream = hRes.GetResponseStream()
oStreamReader = New StreamReader(oStream)
sSessionPage = oStreamReader.ReadToEnd()
oStreamReader.Close()
oStream.Close()
oStreamReader = Nothing
oStream = Nothing
hReq = Nothing
hRes = Nothing
I got the HTML. But I couldnt log in, as i just couldnt get the jscripts invoked.
Then I switched to the GeckoFX control (FireFox).
I could login and display the HTML in my control. But I couldnt grab the HTML and save it to a variable or a file.
Now I want to try this with the CefSharp control.
But I dont even know how to start.
I used the NuGet Package Manager to install the newest stable version.
But now Im stuck creating a control..
How do I create a browser control in CefSharp, how do I open a website at a given URL, invoke jscripts and how can I save the HTML code of the open site?
Hopefully you can help me with this task.
Greetings
Julian