I have the following source of a page only on errors and i would like to search the page for a unique word, then have an if that checks it.
I get the source with curl and at the moemnt i do use an if to do what i want but it doesnt really work
source code
<html>
<head>
</head>
<body bgcolor="#FFFFFF">
<form name="image" method="post" action="libcatlist.asp?action=update&updimage=105971&high=&low=">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><img name="logo" src="../images/logo_admin.gif" width="111" height="45" border="0" alt="bluegreen marine and travel picture library"><br>
<br>
<b class="subjecttitle">Library Management - Update Image Details</b></font></p>
<p><img src="../library/main/ <font face="Arial" size=2>error '80020009'</font>
<p>
<font face="Arial" size=2>Exception occurred.
</font>
<p>
<font face="Arial" size=2>/admin/libupdate.asp</font><font face="Arial" size=2>, line 21</font>
and the code in the script
try
set thesource to do shell script "curl http://www.b....s.com/admin/libupdate.asp?updimage=" & imageNumber
on error theError
display dialog theError
end try
set theIf to "Exception"
^-- curl
if thesource contains theIf then
repeat with i from 1 to elementCount
--makes the image number to item 1 of the list
if i is equal to 6 or i is equal to 12 then
else
--this puts all the information from the textfields in the form to the list
set item i of elementValueList to "XXXXXXXXXXXXX"
end if
end repeat
else if thesource does not contain theIf then
repeat with i from 1 to elementCount
--makes the image number to item 1 of the list
if i is equal to 6 or i is equal to 12 then
else
--this puts all the information from the textfields in the form to the list
set item i of elementValueList to do script "window.document.forms[0].elements[" & (i - 1) & "].value"
end if
end repeat
end if
Basically what should happen is if the page has this unique word then excel should fillt the fields with XXXX if its not then it should get the information.
But it doesnt wrok