[resolved] need help clicking a trickly lil image on a html doc
wrote a little program to comment when my friends post a new instagram picture....so im using statigram a.t.m.
got everything else working so far ...i load my friends pics from my update page...& i can set the "comment" perfectly fine...im just having issues hitting 'send'
Here is the html on the page for the 'send comment' tiny lil question mark looking button
Code:
<a href="#" class="commentAction" id="postComment-402467323865880623_317878733"></a>
I've tried a few things but can't get them to work....here is one thing i tried...unsuccessfully! LoL
Code:
For Each b As HtmlElement In hDoc.GetElementsByTagName("a")
If b.GetAttribute("commentAction").ToLower = "#" Then
b.InvokeMember("click")
Exit For
End If
Next
+ rep for anyone that takes a sec to help me out <3
Re: need help clicking a trickly lil image on a html doc
Bump for anyone that saw the coder.org viral video this month & isn't doing their job right now to help young ppl learn how to code! And to keep more programming jobs in America, instead of being outsourced to India ::cough::
Re: need help clicking a trickly lil image on a html doc
Well, it looks like this isn't a button so it doesn't have a click. It's a straight link so you could try navigating to it but as it's just a simple anchor I suspect that it'll just take you to another part of the page so we probably need to see the HTML from wherever it takes you (assuming it doesn't just work first time).
4 Attachment(s)
Re: need help clicking a trickly lil image on a html doc
Quote:
Originally Posted by
dunfiddlin
Well, it looks like this isn't a button so it doesn't have a click. It's a straight link so you could try navigating to it but as it's just a simple anchor I suspect that it'll just take you to another part of the page so we probably need to see the HTML from wherever it takes you (assuming it doesn't just work first time).
Ok I really spent some time collecting & preparing this data for you. It's a screenshot of the page/button in question. Along with the relevant page html + the code I am currently using. I'm hoping that this gives you all a better idea.
#1) Screenshot ~ the "field sorrounding the comment box & the comment 'submit' link/button" (with 'inspect elements' showing info)
#2) Screenshot ~ the text area immediately above the 'submit' button I am trying to click (with 'inspect elements' showing info)
#3) Screenshot ~ the actual button I am trying to click/submit etc. (with 'inspect elements' showing info)
Attachment 97253
Attachment 97255
Attachment 97257
And finally the raw html of the page. In this text file.
Attachment 97259
Of course every photo I wish to leave my comment on will have a different numerical value. So I need to submit/click based on an unchanging keyword. In this case I would imagine its commentAction or postComment etc.
1 Attachment(s)
Re: need help clicking a trickly lil image on a html doc
Now when you click it with your mouse pointer....it shows this little "spinning animated circle", but you never actually leave the page. Your comment just shows up a second or so later. Here is a screenshot of that.
Attachment 97261
Re: need help clicking a trickly lil image on a html doc
Hmm. Bit of a problem. The relevant section seems to be repeated three times in the page source with more or less identical syntax so I'm not sure how we'd determine exactly which one to use, even if I was sure how to do that! I'll have to have a think.
Re: need help clicking a trickly lil image on a html doc
Quote:
Originally Posted by
dunfiddlin
Hmm. Bit of a problem. The relevant section seems to be repeated three times in the page source with more or less identical syntax so I'm not sure how we'd determine exactly which one to use, even if I was sure how to do that! I'll have to have a think.
Yup this one is definitely a tough one. Usually I'll just go through every single possible keyword until i find the one that lets it get clicked. This time i did that & nothing ever happened. What's weird though is I can set the text area...even though that is also repeated several times.
But I've never posted a situation that you weren't able to figure out :-) I got faith in you DF! Between you and the rest of vbforums. I bet we'll figure it out :thumb:
Re: need help clicking a trickly lil image on a html doc
Quote:
Originally Posted by
jalexander
Usually I'll just go through every single possible keyword until i find the one that lets it get clicked.
Did you try setting the Attribute name to "classname" and checking its Value against "commentaction"?
Code:
If b.GetAttribute("classname").ToLower = "commentAction".ToLower Then
Only send nice comments, now :p
Re: need help clicking a trickly lil image on a html doc
Quote:
Originally Posted by
Inferrd
Did you try setting the Attribute name to "classname" and checking its Value against "commentaction"?
Code:
If b.GetAttribute("classname").ToLower = "commentAction".ToLower Then
Only send nice comments, now :p
You're awesome, thanks for stopping in my post today Inferrd! & YES I tried classname, but i had it as "className" ! OMFrikkinG! My parents used to blast Rod Stewart on our way to church every sunday.....Don't know if you got his music out in the UK...but here's a line for you,, cuz im that happy that i finally got this figured out.
Have i told you lately that i love you. You take away all my sadness....fill my heart with gladness....ease my troubles, thats what you do! LoL
Re: [resolved] need help clicking a trickly lil image on a html doc
Quote:
.Don't know if you got his music out in the UK
You do know he was born in Scotland and had a long and very successful career here before you lot had ever heard of him, right?