[RESOLVED] Isit possible to click just text in webbrowser?
Ill try explain.
Say i have webbrowser 1 and there is some text on a page that is displayed that says something like "Iamsomerandomtext" and its the only text on the page that says that. It has no name or id's or tags or anything.
Would it be possible for me to click it for example :
vb Code:
webbrowser1.document.all("Iamsomerandomtext").click
Sorry if this is just impossible :eek:
Re: Isit possible to click just text in webbrowser?
nope.... it would need a name in order for it to work.... and even if you did click it, since it isn't a link, button or some other clickable item,..... I doubt it would do anything.
-tg
Re: Isit possible to click just text in webbrowser?
Sure you can click on it....it probably won't do anything, but you can click away.
I suspect that if you opened the page in IE or FireFox or some other browser, and clicked on the text, it wouldn't do anything either.
What is it that you want to have happen AFTER you have clicked on it?
Re: Isit possible to click just text in webbrowser?
But don't you need to referr to it by it's NAME attribute? Or its ID attribute.... I mean if it's some random text, not contained within any other context.... ????
-tg
Re: Isit possible to click just text in webbrowser?
1) It is a link!
2)@hack , how could i click on it? I think you mean just click on it myself i mean the program click on it..
3)@techgnome, that is my question :p
Re: Isit possible to click just text in webbrowser?
you can loop through all the links then click if the innertext value matches
use something like
vb Code:
for each ele in web1.document.getelementsbytagname("A")
if ele.innertext = "whatever" then ele.click: exit for
next
not tested
Re: Isit possible to click just text in webbrowser?
Quote:
Originally Posted by westconn1
you can loop through all the links then click if the innertext value matches
use something like
vb Code:
for each ele in web1.document.getelementsbytagname("A")
if ele.innertext = "whatever" then ele.click: exit for
next
not tested
aha it worked :)
Thanks alot.
Im learning quite alot of these forums :D