469,358 Members | 1,556 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,358 developers. It's quick & easy.

How to simulate JavaScript in a client Applications

Hi Guys.
I'm writing a web crawler (web spider) that crawl all links in a website.
My application is a Win32 App, written in C# with .Net framework 3.5.
Now I'm using HttpWebRequest an HttpWebResponse to communicate with the web server.
I also built my own Http Parser that can parse anything I want.
I found all link like "href", "src", "action"... in the parse.
But I can not solve one problem: Simulate Client Script in the page (like JS and VBS)
For example, if a link like:
<a href="javascript:buildLink(1)"> ... with buildLink(parameter) is a Javascript function that will make a custom link due to the parameter.

Please help me to solve this problem. How to simulate JavaScript in this app? I can parse the HTML source code and take all JavaScript code to another file, but how to simulate a function of it?
May 27 '09 #1
4 1725
9,735 Expert Mod 8TB
Well first you're going to have to understand what the JavaScript function does and then translate that into C# code that your application can execute....

It sounds like your application is going to have to translate JavaScript into C#...this is not going to be an easy task and you are going to have to know how JavaScript works so that you can implement an application that knows how to translate it.

Good luck,

May 27 '09 #2
344 100+
Are you going to build a compiler?
May 29 '09 #3
I want to build a crawler, so that I must do anything as a browser can do, but how to?
May 30 '09 #4
344 100+
If you are going to build it from scratch it's not an easy task. I've a compiler exam tomorrow, not easy at all. Look for libraries you can use ActiveX component, I didn't before, or It will take a long time for "simulating".

May 30 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by saeed | last post: by
13 posts views Thread by Kai Grossjohann | last post: by
6 posts views Thread by KKramsch | last post: by
4 posts views Thread by Greg Livengood | last post: by
5 posts views Thread by petermichaux | last post: by
8 posts views Thread by Peter Michaux | last post: by
43 posts views Thread by Bill H | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.