Joel
Joel

Reputation: 405

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.

Upvotes: 6

Views: 1403

Answers (1)

Pavan Gupta
Pavan Gupta

Reputation: 19243

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.

Upvotes: 4

Related Questions