I'm learning Python and Selenium and I'm trying to complete an order and I need to enter the credit card information. The input is currently off the screen about half way down the page. I have this code:
paymentSection = driver.find_element_by_name("cardnumber")
driver.execute_script("arguments[0].scrollIntoView();", paymentSection)
Here is the HTML for the input I'm trying to get to:
<div class="CardNumberField-input-wrapper">
<span class="InputContainer" data-max="4242 4242 4242 4242 4240"><input class="InputElement is-empty Input Input--empty" autocomplete="cc-number" autocorrect="off" spellcheck="false" type="tel" name="cardnumber" aria-label="Credit or debit card number" placeholder="Card number" aria-invalid="false" value="">
</span>
</div>
Here is the error I'm getting:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [name="cardnumber"]