-
Jan 19th, 2022, 05:58 AM
#1
Thread Starter
PowerPoster
[RESOLVED] ON VBA for excel... how to click on wen page button with red circle
i need to simulate a click event on button wìth red circle. ?
image attached.
i use the tipical IE:
....
Set IE = CreateObject("InternetExplorer.Application")
With IE
URL = ""
IE.Navigate URL
IE.Visible = True
Do While IE.Busy: DoEvents: Loop
Do
DoEvents
Loop Until IE.ReadyState = READYSTATE_COMPLETE
end with
Last edited by luca90; Jan 21st, 2022 at 02:07 AM.
-
Jan 19th, 2022, 06:24 AM
#2
Re: ON VBA for excel... how to click on wen page button with red circle
try like
Code:
For Each ele In ie.Document.getelementsbytagname("a")
If InStr(ele.outerhtml, "title=""Prossimo""") Then Exit For
Next
ele.Click
seems to work ok, at least in the short term
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jan 19th, 2022, 08:11 AM
#3
Thread Starter
PowerPoster
Re: ON VBA for excel... how to click on wen page button with red circle
Originally Posted by westconn1
try like
Code:
For Each ele In ie.Document.getelementsbytagname("a")
If InStr(ele.outerhtml, "title=""Prossimo""") Then Exit For
Next
ele.Click
seems to work ok, at least in the short term
GREAT! Tks bro
Work
have idea to get data from the table: Profilo Iscritto Albo
[ur
sorry but not a good experience with DOM
Last edited by luca90; Jan 23rd, 2022 at 11:22 AM.
-
Jan 20th, 2022, 03:32 AM
#4
Re: [RESOLVED] ON VBA for excel... how to click on wen page button with red circle
try like
Code:
Set ele = ie.Document.getelementbyid("pdb-main")
For Each dl In ele.getelementsbytagname("dl")
Debug.Print dl.Children(0).innertext;
Debug.Print vbTab;
Debug.Print dl.Children(1).innertext
Next
but you really need to learn to do some of this for yourself
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|