2

Is it possible to use visual basic to click an I'm Not A Robot checkbox using visual basic.

enter image description here

Here's the code I tried:

ie.Document.getElementById("recaptcha-checkbox-checkmark").Click

The above code was used after creating an ie Object as follows:

Sub DoBusinessSearch()
    Dim strResults As String
    Dim ofacname As String
    ofacname = Excel.Range("Company").Value
    Application.ScreenUpdating = True

    Set ie = CreateObject("InternetExplorer.Application")
    ie.Visible = True
    ie.Navigate "https://mycpa.cpa.state.tx.us/coa/Index.html"
    ie.Fullscreen = True
    Application.StatusBar = "Submitting"
    ' Wait while IE loading...
    While ie.Busy
        DoEvents
    Wend
    ' **********************************************************************
    delay 1
    ie.Document.getElementById("entityName").Value = ofacname
    delay 1
    ie.Document.getElementById("recaptcha-checkbox-checkmark").Click
    delay 1
    ie.Document.getElementById("search").Click
    Application.SendKeys "(%{1068})"

    '**********************************************************************
Mutuelinvestor
  • 3,384
  • 10
  • 44
  • 75
  • 9
    So like... you want to build bot that can fool the recaptcha? If you crack that nut, I think you could sell it to some seedy individuals overseas. [Here's one way](https://www.reddit.com/r/hacking/comments/85mkmm/robot_proof_i_think_not/) ;) – JNevill Aug 27 '18 at 18:54
  • 1
    In all seriousness though, what you are building is, essentially, a bot; which this recaptcha has been specifically designed to prevent. You would have to outsmart Google Engineers that wrote the recaptcha logic. You can read more about how this "I'm not a robot" recaptcha works [at this nicely written Quora answer](https://www.quora.com/How-does-the-I-am-not-a-robot-CAPTCHA-work) – JNevill Aug 27 '18 at 19:01
  • 1
    Would be possible to pause the a vb script let a human check the box and have the script continue. This would be very similar to your video. – Mutuelinvestor Aug 27 '18 at 19:06
  • That's probably the best solution. You can use the `Stop` function to pause the code allowing you to do some interaction, then you can hit `F5` or the `Play` button at the top to start it up from that point. You can also just toss a breakpoint in there for testing where you want to add the `Stop` (place the cursor in whatever line you want to pause on and hit `F9`). – JNevill Aug 27 '18 at 19:07
  • 2
    I would place a user prompt instead with a directive for clicking the captcha. You can use a msgbox for that with a wait time after. – QHarr Aug 27 '18 at 19:08
  • You could make this really difficult if you felt like it by trying to figure out the offset of the button and clicking within a certain area of the button, but that would assume that you only have the check mark and not a puzzle to do https://stackoverflow.com/a/28222246/2727437 – Marcucciboy2 Aug 27 '18 at 20:04

0 Answers0