Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get HTML of page with awesomium

How do I get the HTML of a web page in awesomium with C++?

I've searched and apparently you can only do it with webcontrol in C# or in Java. Using the sample hello I tried doing:

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

but it does not work. any ideas? and please in c++ as i am aware that you can do this in C# and Java.

like image 821
Joel Avatar asked Apr 29 '13 12:04

Joel


1 Answers

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 HTML from the clipboard. I am not sure if there is another way of getting HTML without using Javascript.

like image 71
Pavan Gupta Avatar answered Oct 27 '22 08:10

Pavan Gupta