Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submit form with selenium #68

Open
kselight opened this issue Apr 15, 2020 · 6 comments
Open

Submit form with selenium #68

kselight opened this issue Apr 15, 2020 · 6 comments

Comments

@kselight
Copy link

kselight commented Apr 15, 2020

@ad-m
I use selenium with chromedriver.
I would like to login here: https://listen.tidal.com/login

Actually I get a resolve token from the anti-captcha service and I can insert it into the website, but I can´t submit the form.

def loginTidal(driver, counter):
    global accounts
    tempDetails = accounts[counter].split(':')
    # driver.get("http://tidal.com/login")
    driver.get("https://tidal.com/")
    driver.implicitly_wait(5)
    driver.find_element_by_class_name(
        "btn-link.btn-medium.font-weight-normal.hidden-sm-max"
    ).click()
    time.sleep(2)
    WebDriverWait(driver, 120).until(
        EC.presence_of_element_located(
            (By.CLASS_NAME, "form-input.client-input"))).send_keys(tempDetails[0])
    time.sleep(3)
    url=driver.current_url
    client = AnticaptchaClient(api_key)
    task = NoCaptchaTaskProxylessTask(url, site_key)
    job = client.createTask(task)
    job.join()
    response = job.get_solution_response()
    print("Received solution", response)
    driver.execute_script("document.getElementById('g-recaptcha-response').innerHTML='{}';".format(response))

    time.sleep(2)
    driver.find_element_by_xpath("/html/body/div[1]/div[2]/div[3]/div/div/div/div[1]/div[1]/div/form").submit()
    time.sleep(2)
    password=WebDriverWait(driver, 120).until(
        EC.presence_of_element_located(
            (By.ID, "password"))).send_keys(tempDetails[1])
    WebDriverWait(driver, 120).until(
        EC.presence_of_element_located(
            (By.CLASS_NAME, "position-relative.fullwidth.margin-bottom-1.btn-success.btn-client-primary"))).click()

The problem is that a image challenge occur after I inserted an email in the form.
Do you have an idea to solve my problem?

@ad-m
Copy link
Owner

ad-m commented Apr 20, 2020

Hello,

I have developed a solution for Tidal. The code is available on:
https://github.com/ad-m/python-anticaptcha/blob/tidal/examples/real-cases/tidal.py

In case of problems - let me know. I hope it will help your problem.

I wonder why you need to use Selenium? What other operations do you perform at Tidal?

Greetings,

@kselight
Copy link
Author

Hello,
thanks for your example.
Actually it does not work.
grafik
After hitting the first button the captcha challenge occurs.

This is the thrown exception from python.
grafik

Kind regards

@ad-m
Copy link
Owner

ad-m commented Apr 20, 2020

Thank you for the information. I will try to run it using Chrome tomorrow. In the case of Firefox I have not encountered such problems. Can you try in Firefox?

@kselight
Copy link
Author

Hello,
I have tried it in Firefox, but the same problem occurs.
Additionally Selenium with geckodriver has no DRM-support out of the box. Chrome would be better.

@ad-m
Copy link
Owner

ad-m commented Jun 21, 2020

I think solution with callback sniffer should solve you issue. See https://github.com/ad-m/python-anticaptcha/blob/master/examples/recaptcha_selenium_callback.py . Let's me know if you have issue in integration it.

@fashan7
Copy link

fashan7 commented Aug 23, 2021

problem solved
see #92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants