Get HTML page using awesomium

How to get HTML version of webpage in awesomium with c ++?

I was looking and apparently you can only do this with webcontrol in C # or Java. Using the hi pattern, I tried to do:

JSValue theVal( view->ExecuteJavascriptWithResult(WSLit("document.getElementsByTagName('html')[0].innerHTML"),WSLit(""))); 

but that will not work. any ideas? and please in C ++ as I know you can do this in C # and Java.

+6
source share
1 answer

Using Javascript, you can do it like this:

 web_view->ExecuteJavascriptWithResult("document.getElementsByTagName('html')[0].innerHTML"); 

also you can use:

 web_view->CopyHTML(); 

and then get the HTML from the clipboard. I'm not sure if there is another way to get HTML without using Javascript.

+3
source

Source: https://habr.com/ru/post/943879/


All Articles