Forum Moderators: open
Server-side: Look into reading the file with the filesystem object & using instr() to parse it.
Client-side: Consider using a div or span tag instead of the html comments as delimeters. Then you can access the innerhtml property (I think it's innerhtml search google to find it).
HTH,
Ross
<TITLE> <-- Here and Here --> </TITLE>
I'm self-taught in VBScript, so I really don't know where to start with this one. I know it has something to do with InStr, but have no idea how to apply it.
Care to lend a hand?
foo = "<html><title>some crazy title</title>blah blah blah<br>asdf</html>" 'your html text
Set re = new RegExp 'new regular expressions object
re.IgnoreCase = true 'ignore case when matching
re.Global = false 'stop after first match
re.Pattern = "<title>(.*)?</title>" 'pattern to match
set matches = re.Execute(foo) 'match with contents of foo variable
Response.Write matches.item(0).submatches(0) 'contents of title tag
parse_string1 = foo 'see above post
parse_string1 = replace(parse_string1,"<title>","¦")
parse_string = split(parse_string1,"¦")
parse = parse_string(1)
parse_string1 = replace(parse,"</title>","¦")
parse_string = split(parse_string1,"¦")
parsed_string = parse_string(0)
Response.write parsed_string 'gives final result
:)
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment
/test/script.asp, line 22
I tried to place a conditional statement in there like:
IF Len(Trim(var)) <= 0 THEN
Response.Write "No content found."
ELSE
Response.Write matches.item(0).submatches(0)
END IF
But it didn't work - I assume because it's not even getting to the point of where it can run the condition.
Any suggestions?
Thanks for all of your help.