473,433 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,433 software developers and data experts.

Interpret HTML <Script> in Visual Basic

My program (it's a webcrawler) downloads htmlpages and in some cases the
html has <script> </script> tags in it that generates parts of the html.

How can i interpret this javascript and get the resulting html.

Im hoping for something very simple:

Dim page as string = downloadWebPage(www.page.com\index.htm) 'raw html
Dim newPage as string = interpreter.processScripts(page)

'do my parsing of the newPage string to get links.

anyone have any links to javascript interpreters for use in .net?
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
Apr 4 '06 #1
3 1836
Google for SpiderMonkey. Maybe you can use that (you will have to make
unmanaged calls dough).
Or maybe JScript is what you are looking for.

Or the eaisest way would be to use the web browser control load the
page into the control and then get the generated HTML from there.
lp
Jan Hancic
http://cwizo.blogspot.com

Apr 4 '06 #2
Op Tue, 4 Apr 2006 21:03:08 +0200 schreef Jarod_24:
My program (it's a webcrawler) downloads htmlpages and in some cases the
html has <script> </script> tags in it that generates parts of the html.

How can i interpret this javascript and get the resulting html.

Im hoping for something very simple:

Dim page as string = downloadWebPage(www.page.com\index.htm) 'raw html
Dim newPage as string = interpreter.processScripts(page)

'do my parsing of the newPage string to get links.

anyone have any links to javascript interpreters for use in .net?
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***


You intend to write a program that reads webpages and executes all
(java)scripts on it? Do you know the possibilities of JavaScript well
enough to be able to realise the possible consequences of this? It seems
like a dangerous thing to do. I would advise you to reconsider...

Renze de Waal.
Apr 5 '06 #3
"Renze de Waal" <re***@dewaal.speedlinq.nl> wrote in message
news:1l******************************@40tude.net.. .
Op Tue, 4 Apr 2006 21:03:08 +0200 schreef Jarod_24:
My program (it's a webcrawler) downloads htmlpages and in some cases the
html has <script> </script> tags in it that generates parts of the html.

How can i interpret this javascript and get the resulting html.

Im hoping for something very simple:

Dim page as string = downloadWebPage(www.page.com\index.htm) 'raw html
Dim newPage as string = interpreter.processScripts(page)

'do my parsing of the newPage string to get links.

anyone have any links to javascript interpreters for use in .net?
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from
http://www.SecureIX.com ***


You intend to write a program that reads webpages and executes all
(java)scripts on it? Do you know the possibilities of JavaScript well
enough to be able to realise the possible consequences of this? It seems
like a dangerous thing to do. I would advise you to reconsider...

Renze de Waal.


I'm aware of the consequences. It's one of the reasons why i'd prefer not to
use the WebBrowser control that is included in Visual Studio 2005.
The control basically gives you a IE window in your app, with no ability to
control pop ups, activex'es and so on.

An Javascript interpreter (not java) is what i'm looking for. If that
interpreter had some ability to turn on/off specific features possible in
javascript then even better.

As far as i've understood, you cant give the Windows Scripting Host (WSH)
html and expect to get out the completed result, it needs a well written .js
script wich is nothing like the mish-mash of <html> and <script> tags and
everthing else that a webpage has.
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
Apr 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Madhav | last post by:
I have the following statements in my script. ---------------------------------------------------------- textToWrite = "<HTML> \n" + "<HEAD> \n" + "<TITLE>Calendar</TITLE> \n" + "<SCRIPT...
30
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript>...
10
by: Blue® | last post by:
I would like to call the content of content.htm (containing only HTML codes) into index.htm. This is usually done by renaming index.htm to index.shtml and use this tag: <!--#include...
5
by: David Thielen | last post by:
Hi; Almost all of the Quick Starts show the code in the .aspx file inside a <script> instead of in a seperate .aspx.cs file. My instinct is that the code should be in a seperate file to keep the...
12
by: Iddo | last post by:
Hi, I am having a strange problem... I have an HTML file which has 2 script tags: 1) <script language="javascript" id="ABC" src="ABC.js" /> 2) <script id="general" language="javascript">...
44
by: rhythmace | last post by:
W3C HTML validator passes this: .... <script type="text/javascript" src="foo.js"> <script type="text/javascript"> ....script in here... </script> ....
2
by: -Karl | last post by:
Couls someone please advise me on this error. What I am trying to do is be able to convert an XML document into arrays. I read that the subs & functions have to be in <scripttags. Thanks! ...
0
by: Chetana | last post by:
Hi, Following code is working in FireFox, but it is not working in IE. Response.Write("<script>window.opener.location.href='ViewDepartment.aspx';</ script>"); So Please Let me know if...
3
by: joe | last post by:
Is it OK to have multiple: <script type="text/javascript" src="funcs1.js"></script> <script type="text/javascript" src="funcs2.js"></script> <script type="text/javascript"...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.