0

Link: https://mail.protonmail.com/create/new?language=en

Problem

chrome.find_element_by_xpath("//input[@type='submit']").click()

Python cannot find the submit button id, name, or class in the HTML code

HTML:

<button type="submit" class="btn btn-submit" name="submitBtn">Create Account</button>

1
  • 3
    your tag name is button, not input. And be sure that the page javascript was loaded and you don't search button before it ready. Commented Feb 26, 2020 at 18:19

1 Answer 1

2

First you need to switch to iframe witch contains submit button. The you can find it and submit.

from selenium import webdriver
import os
import time

browser = webdriver.Chrome(executable_path =os.path.abspath(os.getcwd()) + "/chromedriver")
browser.get("https://mail.protonmail.com/create/new?language=en")
# wait page to load
time.sleep(3)
# find iframe
iframe = browser.find_element_by_css_selector('iframe[data-name="bottom"]')
# switch into iframe
browser.switch_to.frame(iframe)
browser.find_element_by_class_name('btn.btn-submit').click()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.