I code the Add to Cart function on WellGosh.com using Selenium in Python.
I have a code that is the right size to add to the cart and log into my account and go to the correct delivery address, but when I try to confirm the delivery method (fedex), it will not allow me to click the continue button.
Here is a sample code to verify:
def Checkout():
driver.get('https://wellgosh.com/checkout/cart')
checkout=driver.find_element_by_xpath('//*[@id="shopping-cart-table"]/tfoot/tr/td/div[2]/a')
checkout.click()
login=driver.find_element_by_xpath('//*[@id="login-email"]')
login.send_keys(e_mail)
password=driver.find_element_by_xpath('//*[@id="login-password"]')
password.send_keys(Pass)
LogIn=driver.find_element_by_xpath('//*[@id="checkout-step-login"]/div/div[2]/div/button')
LogIn.click()
cont=driver.find_element_by_xpath('//*[@id="billing-buttons-container"]/button')
cont.click()
driver.implicitly_wait(100)
element = driver.find_element_by_xpath('//*[@id="shipping-method-buttons-container"]/button')
element.click()
I get this error:
selenium.common.exceptions.ElementNotVisibleException: Message: item not displayed
This is a snippet of HTML code:
</script>
</div>
<div class="buttons-set" id="shipping-method-buttons-container">
<p class="back-link"><a href="#" onclick="checkout.back(); return false;"><i class="fa fa-chevron-left plain"></i>Back</a></p>
<button type="button" class="button btn-continue" onclick="shippingMethod.save()">Continue</button>
<span id="shipping-method-please-wait" class="please-wait zoooooom" style="display:none;">
<i class="fa fa-cog fa-spin plain"></i>
</span>
</div>
</form>
source
share