Results 1 to 10 of 10

Thread: [resolved] need help clicking a trickly lil image on a html doc

  1. #1

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    [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
    Last edited by jalexander; Mar 2nd, 2013 at 06:44 PM. Reason: special thanks to Inferrd & dunfiddlin :-)
    dim jenn as geek = true
    Learning ~ Visual Basic 2010 ~ in free time between college/work -
    currently looking for a 'programming buddy' / 'coder friend' / and or 'mentor'. p.m. me if you
    have ANY free time AT ALL I'm like 33% of a novice level ~ willing 2 listen/learn +
    i am totally super motivated & promise to make an effffin amazing protege!!! #swag

    | -_-_- -_-_- |
    ...W.T..F!?.....
    ||| Matter on the atomic/quantum level isn't solid or even matter at all. It can also exist in at least 2 places simultaneously (demonstrated in lab). It's position can only be established when it's actually observed. If we turn our back on it... it goes back to a wave form. History show's that every previous generation (since the beginning of time) got almost everything wrong. Then it might very well stand to reason that up is down & right can be wrong. Admit it.. our combined perception of reality is just that, we know absolutely nothing of actual reality & to think we do is simply subscribing to a "ignorance is bliss" mantra |||

  2. #2

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    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::

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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).
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    Re: need help clicking a trickly lil image on a html doc

    Quote Originally Posted by dunfiddlin View Post
    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)
    Name:  detail1.jpg
Views: 88
Size:  389.4 KB
    Name:  detail2.jpg
Views: 99
Size:  336.3 KB
    Name:  detail3.jpg
Views: 92
Size:  342.0 KB


    And finally the raw html of the page. In this text file.
    code.txt

    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.
    dim jenn as geek = true
    Learning ~ Visual Basic 2010 ~ in free time between college/work -
    currently looking for a 'programming buddy' / 'coder friend' / and or 'mentor'. p.m. me if you
    have ANY free time AT ALL I'm like 33% of a novice level ~ willing 2 listen/learn +
    i am totally super motivated & promise to make an effffin amazing protege!!! #swag

    | -_-_- -_-_- |
    ...W.T..F!?.....
    ||| Matter on the atomic/quantum level isn't solid or even matter at all. It can also exist in at least 2 places simultaneously (demonstrated in lab). It's position can only be established when it's actually observed. If we turn our back on it... it goes back to a wave form. History show's that every previous generation (since the beginning of time) got almost everything wrong. Then it might very well stand to reason that up is down & right can be wrong. Admit it.. our combined perception of reality is just that, we know absolutely nothing of actual reality & to think we do is simply subscribing to a "ignorance is bliss" mantra |||

  5. #5

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    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.

    Name:  detail4.jpg
Views: 98
Size:  55.8 KB

  6. #6
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  7. #7

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    Re: need help clicking a trickly lil image on a html doc

    Quote Originally Posted by dunfiddlin View Post
    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

  8. #8
    Frenzied Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    1,335

    Re: need help clicking a trickly lil image on a html doc

    Quote Originally Posted by jalexander View Post
    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

  9. #9

    Thread Starter
    Addicted Member jalexander's Avatar
    Join Date
    Jan 2011
    Location
    Memphis, TN
    Posts
    160

    Re: need help clicking a trickly lil image on a html doc

    Quote Originally Posted by Inferrd View Post
    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
    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

  10. #10
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: [resolved] need help clicking a trickly lil image on a html doc

    .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?
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width