6

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.

Tarod
  • 6,732
  • 5
  • 44
  • 50
Joel
  • 385
  • 1
  • 3
  • 15

1 Answers1

4

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.

voytek
  • 2,202
  • 3
  • 28
  • 44
Pavan Gupta
  • 17,663
  • 4
  • 22
  • 29