473,759 Members | 7,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to simulate JavaScript in a client Applications

2 New Member
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="javascrip t:buildLink(1)" > ... with buildLink(param eter) 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?
Thanks.
May 27 '09 #1
4 2078
Frinavale
9,735 Recognized Expert Moderator Expert
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,

-Frinny
May 27 '09 #2
Bassem
344 Contributor
Are you going to build a compiler?
May 29 '09 #3
c0mm3nt
2 New Member
I want to build a crawler, so that I must do anything as a browser can do, but how to?
May 30 '09 #4
Bassem
344 Contributor
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 ".

Regards,
Bassem
May 30 '09 #5

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

Similar topics

7
6146
by: saeed | last post by:
hello I need a php file to simulate "ftp server" in port 80. (NO web based ftp) I want to connnet to my "php ftp server" with client program like "cuteftp" but in port 80. for example ftp server like this: http://www.mysite.com/test/ftp.php if you have any info, exmample, likn, please ... ???
13
9458
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to intercept the key so that I can do stuff on the server side to make the new window behave correctly? (We have a JSP-based webapp which stores state in the session. Now if two windows access (and modify!) the same session, then madness will result....
6
1862
by: KKramsch | last post by:
OK, here's the scenario: I have a CGI script that generates a page with frames (BTW, I'm not crazy about frames, but in this case the decision to use them is out of my hands). In a typical session, the user interacts with two of these frames extensively, and up to the very end of the session, this interaction is handled entirely client-side by a fairly elaborate JavaScript script. (This interaction takes place exclusively via HTML...
6
2314
by: Nou Dadoun | last post by:
I'm currently developing an application in C++/MFC (Visual Studio 6, if that makes a difference) and I'd like to avoid the Windows style UI widgets and dialogs if at all possible. In fact, what I'd really like to do is use HTML/web pages as the user interface and invoke my application in the background to do the heavy lifting. I'm fairly well experienced with web pages and I've written a fair amount of JavaScript at one time or another...
4
1908
by: Greg Livengood | last post by:
I need to test my ASP.net web application for the case that the client browser doesn't support cookies or for the case that cookies are turned off on the client browswer. What is odd is that when I go to the IE (6.0) Tools | Internet Options | Privacy Tab and select "Block All Cookies" level the following still returns true in my Page_Load Request.Browser.Cookies This plus the fact that the client side javascript and my ASP.Net...
0
2636
by: yinxi | last post by:
I' m trying to integrate an application using a web-based interface to our firm application. it has required login information at the beginning. on the login page it has one field to give in the password, and one button to submit the input. It is a javascript form in background as i check the source code. Is it possible to simulate it with a HTTP client in Java with POST? Or is there any other trick? cheers, XP
5
2088
by: petermichaux | last post by:
Hi, Some servers return JavaScript as the response to an AJAX request. When the response JavaScript is eval'ed it calls other JavaScript functions already in the browser to update elements, etc. This seems like a good system because it allows so much freedom in creating the desired behavior in the browser. The required data doesn't have to be converted to XML or JSON on the server. The browser doesn't have to have templates for...
8
1836
by: Peter Michaux | last post by:
Hi, I'm sure many here have already noticed this but it seems that the development of the browser world is paralleling the development of the computer world. However, the browser world is about 20 years behind like back in the days of mainframes and dumb terminals just capable of running a window manager. Instead now we have servers and browsers. In a way I make me feel a little like browser scripting is already archaic because this...
43
2398
by: Bill H | last post by:
25 years ago every computer came with some form of Basic interpreter so you could use yoru computer without having to buy more software. Is Javascript (teamed with HTML) set to become the new Basic, where anyone with a computer can start writing code without having to purchase any expensive languages? Bill H
0
9521
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9333
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9945
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7324
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3442
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.