|
|
So i figured out how to identify an "Input" element and click it with .click() but now I have an image that I want to simulate a click on and can't seem to figure out how to make that happen. I can't call out the image by ID so I am currently parsing the whole page and getting back a list of elements I can search for the image name I want. I get the position of the one I want to click and try the .click() on it and nothing happens. In the example below I am trying to simply click the last one that is valid.
This is and example of the image tag ...
Does anyone know of any way that I can have the script actually simulate a click on this image for me? Any help would be appreciated. Thanx MJ |
|
|
First of all... that long procedure for finding Buff.png is not needed and can be summed up in one line.
Then you can use this (I think so - untested)
|
|
|
Hmmm... not working ... Perhapse I should create a link that runs this from a function rather than trying to run it with the page load... I will play around with it this evening. Thanx for the help though I appreciate it =) M |
|
|
Well embedding it as a function and using a click to activate the function didnt work either. :( |
|
|
Once you have the element, look at the links in this topic for some help on clicking it. |
|
|
If there is an active event listener, you can "click it" with: unsafeWindow.document.evaluate("//img[contains(@src, 'Buff.png')]", document, null, 9, null).singleNodeValue.onclick()
Otherwise, it'll be a bit more complicated than that. |
|
|
I found the solution. I get the element I want to click and then use the following code instead of the .click() I have several I want to click with a delay between each and that was alot harder to implement than I thought but setTimeout and cookies are my friends and they helped alot =) Thanx
|