1

I am trying to create an add to car bot which finds the item and selects the size and fills out the user billing and card information. I am currently stuck on the checkboxes of the site. I've tried to use the XPath of the checkbox and it gives me an error or it won't execute.

The website I am using is as below:

https://www.supremenewyork.com/checkout

Below is a picture of the checkout page with the checkbox enter image description here

Here is the html elements used for the code enter image description here

Below is my code that I used to get the program to find the checkbox element and use a .click() to select the box.

Checkboxes = browser.find_element_by_xpath('//*[@id="cart-cc"]/fieldset/p[2]/label/')
Terms = ActionChains(browser).move_to_element(Checkboxes).click()
Terms.perform()

1 Answer 1

1

use below code:

Webelement element = browser.find_element_by_xpath('//label[./div[@class="icheckbox_minimal"]/input[type="checkbox"]]/div/input');
element.click();
Sign up to request clarification or add additional context in comments.

3 Comments

Can you please provide me more info
use this xpath //*[@id="order_terms"]
Sometime action not work and please accept my answer if its work for you

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.