use cefsharp as html parser

232 views
Skip to first unread message

Mehdi Bagheri

unread,
Sep 25, 2013, 6:24:38 AM9/25/13
to cefs...@googlegroups.com
hi
i want to use cefsharp for parsing HTML and also running some javascript
i have a a HTML page full of content and want to grab just text from it with JQuery
so i want to load my HTML to a webview and run $('body').text(); for example on it
and return the pure text separated from HTML
and also i don't want to add webview to my form.

what can i do?

thanks.

Jim Bourekas

unread,
Sep 27, 2013, 8:25:13 AM9/27/13
to cefs...@googlegroups.com
Hello,

First you need to run the JQuery (if your html does not have it by default) by using the .executeScript command. Then you will be able to run all jQuery commands using the .evaluateScript command which returns stuff from javascript. Another option would be to share a c# object with the Javascript by using the binding method.

I don't think that you have to add the webview to your form as long as you instantiate it as an object somewhere in your code.

Unless there's something else that you mean.

jim
Reply all
Reply to author
Forward
0 new messages