I need to fill a form on a webpage and bypass its captcha. using this library I'm able to solve the captcha and get g-recaptcha-response stored in a variable. now the question is, how to pass the validation token to the form using Mechanize?
here's my half-baked code:
br = mechanize.Browser()
br.addheaders = [("User-agent","Mozilla/5.0")]
url = "https://removedforprivacyreasons.com"
response = br.open(url)
br.select_form(nr=0)
br.find_control("consentGivenPP").items[0].selected=True
br.form['email'] = fullemailaddr
br.form['firstName'] = randomstring
br.form['lastName'] = randomstring
br.form['company'] = 'CloudFlare'
br.submit()
I tried using
br.form['g-recaptcha-response'] = g_response
but I guess that is not the correct way.