Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
421 B
3
Indexable
Never
use_item_variable = "//a[contains(@href," + "'" + item + "')]"
use_size_variable = "//label[contains(text()," + "'" + size + "')]"


def buy_product(sizing):
    driver.find_element(By.XPATH, "//button[@class='coi-banner__accept']").click()
    time.sleep(1)
    driver.find_element(By.XPATH, use_variable).click()
    time.sleep(2)
    driver.find_element(By.XPATH, use_size_variable).click()
    time.sleep(5)