Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

any help on iWB2 Learner?


  • Please log in to reply
14 replies to this topic
side
  • Members
  • 168 posts
  • Last active: Nov 30 2014 03:41 PM
  • Joined: 01 Nov 2012
i am dropping the cursor over a login button but NAME box is empty
only index is filled
how can i use it with COM ? :/

Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
You can use something like

All[ Index ]
OR
getElementsByTagName(" Tag of Button here ")[ Tag Index here ]

Video:
look from one minute and on...
http://www.youtube.com/watch?v=0lgTc9hBMs8

Hope it helps
Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

side
  • Members
  • 168 posts
  • Last active: Nov 30 2014 03:41 PM
  • Joined: 01 Nov 2012
epic help!

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
Additionally, I'm assuming this button is part of a form. If you have dropped the cursor over the button, you might try selecting the Show Parent Structure option. If you look at the parents, you should find a Form object, which usually has a name/id. You can most likely access the form object & use the Submit method. For instance, on the gmail login page you can mimic clicking the Sign in button with:
document.getElementById("gaia_loginform").submit()



tommy
  • Members
  • 84 posts
  • Last active: Nov 03 2014 06:15 AM
  • Joined: 05 Oct 2010
Hi - I've been reading up on all the com threads and can't seem to find one that will help me out with a specific problem. When I use the iWebBrowser2 and drop the cross-hairs over a button I need to click, I don't get an ID or a name, just an index number and I notice this index number changes from session to session. The only other text I get is in the outerHTML. I've tried everything from tagname to ID and can't seem to figure it out. It is actually the "Zoom In" button on Google Map. If anyone can point me in the right direction that would be great. So far this was the last try at it and it didn't work:


pwb.document.GetElementByID("Zoom In").outerHTML.click()

jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
Check out how Blackholyman clicks the Sign In button in the video above.

tommy
  • Members
  • 84 posts
  • Last active: Nov 03 2014 06:15 AM
  • Joined: 05 Oct 2010

Yes - I tried that method but when I run the iWebBrowser2 all I get on the top is <DIV> and nothing else except what is in the outerHTML.  By the looks of the above video, in orde to use 'GetElementsByTagName'  I also need the [number] which it doesn't show one.  Any other ideas?

 

Right now this is what I have for the line: pwb.document.GetElementsByTagName("DIV")[no # shown in iWebBrowser2].click()



jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009

That's odd - the tag number should calculate once you release the cross-hair over the element. Anyways, it seems to be dynamic. You could get creative & accomplish this many ways - here's one example:

wb.document.getElementById("lmc3d").childNodes[3].childNodes[1].click()

 

Note - the lmc3d element doesn't exist right away when the document loads.



tommy
  • Members
  • 84 posts
  • Last active: Nov 03 2014 06:15 AM
  • Joined: 05 Oct 2010

OK - that worked. Now can you explain what that all means so I can learn from it.  I have to also click the Zoom Out and a few other buttons on the page that have the same characteristics.  Thanks



jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
... better yet, can you explain to me how it works so you can learn from it? Then you will aquire the skills to figure out whatever else you need.

webbrowser object
document object
getElementById method
childNodes property
click method

tommy
  • Members
  • 84 posts
  • Last active: Nov 03 2014 06:15 AM
  • Joined: 05 Oct 2010

I got as much that the ID lmc3d is the navigation controls of the page, but how did you see this ID?  I can't see it anywhere with the iWebBrowser2.  As for the Childnodes this is where I am lost.  I tried changing the value and it errors out. Is there a way to see all of the nodes within the ID so I can identify which node does what?



jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009

Did you look at the Parent Structure of the Zoom In element?



tommy
  • Members
  • 84 posts
  • Last active: Nov 03 2014 06:15 AM
  • Joined: 05 Oct 2010

I don't know how to do that and now it seems its not working so perhaps it is dynamic.



tommy
  • Members
  • 84 posts
  • Last active: Nov 03 2014 06:15 AM
  • Joined: 05 Oct 2010

Now that it has been identified that the above ended up not workng later (seems to be dynamic), you had mentioned I could get creative & accomplish this many ways - Can you provide another way that this might be accomplished?



jethrow
  • Moderators
  • 2854 posts
  • Last active: May 17 2017 01:57 AM
  • Joined: 24 May 2009
div := wb.document.getElementById("lmc3d").getElementsByTagName("div")
Loop % div.length
	if (div[A_Index-1].title = "Zoom In") {
		div[A_Index-1].click()
		break
	}