Avatar of s_kennedy
s_kennedy
Flag for Canada asked on

How can I parse a remote website with JavaScript?

I have a heavily locked down machines on a LAN (no internet access).

I need to create some form of application that will parse a remote web page for a certain word, and display a message if it is found.

Due to the restrictions on the machine (I can't run any applications, I can't run any vbs files, etc), I believe the best option is JavaScript running through Internet Explorer 6, but I am open to other ideas.

For a real example that can be tested, I would like to be notified if http://www.google.ca contains the word "Web" (it does).

My main issue seems to be with the same origin policy, but I don't know if there's a way around that, since I only want to read the remote site, and not interact with it.
JavaScript

Avatar of undefined
Last Comment
s_kennedy

8/22/2022 - Mon
Michel Plungjan

can you run HTA ?



<html>
<head>
<script>
function showData() {
  var html = if1.document.getElementsByTagName('html')[0].innerHTML
  document.getElementById('t1').value=html
  var webPos = html.toLowerCase().indexOf('web');
  if (webPos!=-1) alert('web found :' +html.substring(webPos-10,webPos+10))
 
}
</script>
</head>
<body>
<textarea id="t1" style="width:100%; height:5%"></textarea><br />
<iframe name="if1" style="width:100%; height:95%" src="http://www.google.ca" application="yes" onLoad="showData(this)"></iframe>
</body>
</html>

Open in new window

s_kennedy

ASKER
You had me so excited for a minute, but I can't run hta's.
Michel Plungjan

Then I am afraid you need some online tool

http://www.google.com/search?q=online+alert+changed+website
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
s_kennedy

ASKER
The problem is that there's no internet connection, so it needs to be running within the LAN.
ASKER CERTIFIED SOLUTION
Michel Plungjan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
s_kennedy

ASKER
Thanks for your help.