I have a web crawler but it has problems with .js, for example if you open this site: [[login to view URL]][1] and download the main page you will get:
<script type="text/javascript" language="JavaScript">
function endsWith(str, suffix) {
return [login to view URL](suffix, [login to view URL] - [login to view URL]) !== -1;
}
//alert(endsWith([login to view URL] ,'[login to view URL]' ));
if(endsWith([login to view URL] ,'[login to view URL]' ) ){
// [login to view URL]
window.location.href="http://"+document.domain+"/smartsource/[login to view URL]";
}else if(endsWith([login to view URL] ,'[login to view URL]' ) ){
//[login to view URL]
window.location.href="http://"+document.domain+"/utilisource/[login to view URL]";
}else if(endsWith([login to view URL] ,'[login to view URL]' ) ){
//[login to view URL]
window.location.href="http://"+document.domain+"/smartsource/[login to view URL]";
}else{
}
</script>
I need a C++ class that will receive the html file and will parse and execute the .js and will return the html after the .js has been executed.
Few notes:
1. Don't use Microsoft parser.
2. Make sure that during the parsing no Windows will open (like if you use MS parser)
You will probably need to use one of the existing .js parser, please let me know which one you plan to use, also project should not use MFC.