python - How to pass a hidden recaptcha with mechanize? -


I am trying to fill the form on a website for academic purposes by automating Ajax's mechanization.

When a person completes the form and presents it, then there is no re-inventory

But when I fill out the controls for the form through mechanization in Python , Then there is a hidden control which is a reCapta apparently.

& lt; Hidden controls (recaptcha_response_field = manual_challenge) & gt;

Since this reCAPTCHA is never shown to any human, I do not know what it is looking for, or for that matter which is a manual-challenge.

So my question is how can I pass this challenge so that I can continue with automation / mechanization?

I posted the script I am using below, if there is any mistake with it.

import import import #constants TEXT = "Hello world!" Br = mechanize.Browser () #Igoror robots.txt br.set_handle_robots (false) br.addheaders = [('user - Agent ',' Firefox ')] # Page response = br.open ("http: // Somewebsite.com") # This is the available form. Br.select_form ("form2") br.form.set_all_readonly (false) cText = Br.form.find_control ("text") cText.value = TEXT #now Submit our feedback Feedback = br.submit () br.back () # Printing the URL for the error printing. Metal () # text to a text file s = response.read () w = Open ("test.txt", 'W') Print & gt; W, s w.close ()

This site is clearly visible to robots like you Protection against is set if it really matches for academic purposes and demands data.

To get around the site safety measures - this is completely different, but you should see how they know that you are a bot - is there any JavaScript that you are not running , Are you using the MacNet user agent etc. You probably do not want to enter that battlefield with them.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -