Load a DOM and Execute javascript, server side, with .Net -


i load dom using document (in string form) or url, , execute javascript functions (including jquery selectors) against it. totally server side, in process, no client/browser.

basically need load dom , use jquery selectors , text() & type val() functions extract strings it. don't need manipulate dom.

i have looked @ .net javascript engines such jurassic , jint, neither support loading dom, , therefore can't need.

i willing consider non .net solutions (node.js, ruby, etc) if exist, prefer .net.

edit below answer, i'm trying different route, i'm attempting port envjs jurassic. if can working think want, stay tuned....

the answer depends on trying do. if goal complete web browser simulation, or "headless browser," there number of solutions, none of them (that know of) exist cleanly in .net. mimic browser, need javascript engine , dom. you've identified few engines; i've found jurassic both robust , fastest. google chrome v8 engine popular; neosis javascript.net project provides .net wrapper it. it's not quite pure .net since have non-.net dependency, integrates cleanly , not trouble use.

but you've noted, still need dom. in pure c# there xbrowser, looks bit stale. there javascript-based representations of entire browser dom jsdom, too. run jsdom in jurassic, giving dom simulation without browser, in c# (though slowly!) run fine in v8. if outside .net realm, there other better-supported solutions. this question discusses htmlunit. there's selenium automating actual web browsers.

also, bear in mind lot of work done around these tools testing. while doesn't mean couldn't use them else, may not perform or integrate kind of stable use in inline production code. if trying real-time html manipulation, solution mixing lot of technologies not aren't used except testing might poor choice.

if need html manipulation, , doesn't need use javascript thinking more wealth of such tools available in js, @ c# tools designed purpose. example html agility pack, or own project csquery, c# jquery port.

if trying take code written client, run on server -- e.g. sophisticated/accelerated web scraping -- i'd search around using terms. example this question discusses this, answers including http://phantomjs.org/">phantomjs, headless webkit browser stack, of testing tools have mentioned. web scraping, imagine can live without being in .net, , may reasonable answer anyway.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -