Reputation: 73
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
Here is the html elements used for the code
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()
Upvotes: 1
Views: 4282
Reputation: 99
use below code:
Webelement element = browser.find_element_by_xpath('//label[./div[@class="icheckbox_minimal"]/input[type="checkbox"]]/div/input');
element.click();
Upvotes: 1