Monday, May 24, 2010

How to check text on a website in visual basic 6?

I'm trying to build a program to check if a certain word or text is on a website





then if the word is found it display a message box





,but I don't know how to make it check if the word/string exist

How to check text on a website in visual basic 6?
You'll want to use the InStr() function. With this function you can look at one string and find the position of a substring inside it! For example...


InStr(1,"Hello World!","World")


would return the integer 7, because that's the starting position of the substring "World" in the string "Hello World!"





More usage examples:


InStr(1,"Hello World!","o") returns 5


InStr(6,"Hello World!","o") returns 8, because that '6' tells it to start looking for the substring at/after the 6th character in the string.





You'll want to look in the specifications for the HTML DOM


(Document Object Model) and find the methods and properties of that Document Object, and then determine where on the page you want to find that string.





Happy Trails!


No comments:

Post a Comment