Git Product home page Git Product logo

Comments (16)

ad-m avatar ad-m commented on June 3, 2024

I am sorry, I am miss your inquire. I will look at it on the weekend and look for a solution!

Do you have any example website which use that in this way?

from python-anticaptcha.

kadnan avatar kadnan commented on June 3, 2024

It happens on Zillow.com, no page as such atm but it seems it uses this: https://developers.google.com/recaptcha/docs/display#explicit_render

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

I don't see any important differences related to use explicit render. f you have explicitly render the reCAPTCHA widget you have to:

  1. sniff some way sitekey from website (lookup source code or analyse network traffik) - see https://anticaptcha.atlassian.net/wiki/spaces/API/pages/9666575/Reproducing+Recaptcha+validation+without+digging+the+HTML+source ,
  2. send sitekey using our library to Anti-captcha.com,
  3. send solution received from Ant-captcha.com to target website.

I am unable to reproduce captcha at Zillow.com, so I am unable to provide any snippet to help you. If you have any real website I can write snippet to integrate our library for you.

from python-anticaptcha.

kadnan avatar kadnan commented on June 3, 2024

The issue is, there is no hidden/visible form submission. It shows Captcha message and once it thinks it is not, it fades away once they think it is not. They are using PerimeterX service to avoid bots.

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

@kadnan , i believe you can still simulate that using Selenium. See #19 for example integration.

from python-anticaptcha.

kadnan avatar kadnan commented on June 3, 2024

@ad-m

Are you referring this?

# Inject response in webpage
driver.execute_script('document.getElementById("g-recaptcha-response").innerHTML = "%s"' % response)

# Wait a moment to execute the script (just in case).
time.sleep(1)

# Press submit button
driver.find_element_by_xpath('//button[@type="submit" and @class="btn-std"]').click()

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

@kadnan , yes, let's try to use it if you can.

from python-anticaptcha.

kadnan avatar kadnan commented on June 3, 2024

there is no Submit button hence driver.find_element_by_xpath('//button[@type="submit" and @class="btn-std"]').click() is not valid in my case. The issue is how to send solved response.

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

@kadnan the solved respone should be sent in a standard manner in which the application expects it. If you have such a message in your browser - you can use Network Monitor to capture the correct request. Then you have to simulate them in the script.

from python-anticaptcha.

kadnan avatar kadnan commented on June 3, 2024

@ad-m

I finally found the html of the zillow page with Captcha. Here is the Dropbox link

https://www.dropbox.com/s/mo5cpitd3hl72qz/zillow_captcha.zip?dl=0

from python-anticaptcha.

kadnan avatar kadnan commented on June 3, 2024

@ad-m you there?

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

@kadman, in your source code you should implement that part JavaScript code as Python code:

function handleCaptcha(response) {
    var vid = getQueryString("vid"); // returns part "vid" from query string of current page
    var uuid = getQueryString("uuid"); // return part "uuid" from query string of current page 
    var name = '_pxCaptcha';
    var cookieValue =  btoa(JSON.stringify({r:response,v:vid,u:uuid})); // create object using previous defined values, json.dumps then base64 encode)
    var cookieParts = [name, '=', cookieValue, '; path=/'];  // set previous value in cookie named "_pxCaptcha"
    cookieParts.push('; domain=' + window.location.hostname);
    cookieParts.push('; max-age=10');//expire after 10 seconds
    document.cookie = cookieParts.join('');
    var originalURL = getOriginalUrl("url");  // returns decoded param "name" from URL (it's relative path)
    var originalHost = window.location.host;
    var newHref = window.location.protocol + "//" + originalHost;
    originalURL = originalURL || '/';
    newHref = newHref + originalURL; // convert relative path to absolute 
    window.location.href = newHref; // Redirect user
}

More or less it mean that you should update your cookie & create request to new URL.
That function was used in following part of code:

<div class="g-recaptcha" data-theme="white" data-callback="handleCaptcha" data-sitekey="6Lcj-R8TAAAAABs3FrRPuQhLMbp5QrHsHufzLf7b">

According to google documentation data-callback mean:

Optional. The name of your callback function, executed when the user submits a successful response. The g-recaptcha-response token is passed to your callback.

from python-anticaptcha.

kadnan avatar kadnan commented on June 3, 2024

OK i will check this out and get back to you.

BTW, did you check this?

https://webmasters.googleblog.com/2018/10/introducing-recaptcha-v3-new-way-to.html

Will it make impact in existing libary?

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

@kadnan , at that moment it's out of scope of that library, because upstream Anti-captcha.com provider don't support it yet. See at https://anti-captcha.com/clients/help/noproblem/topic/268 at following question:
obraz

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

Closed as no response and provided solution.

from python-anticaptcha.

ad-m avatar ad-m commented on June 3, 2024

Latest releaese added support for Recaptcha V3: https://python-anticaptcha.readthedocs.io/en/latest/changes.html#id1

from python-anticaptcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.