Skip to content

Instantly share code, notes, and snippets.

@bbchriscesar
Created April 14, 2019 20:20
Show Gist options
  • Select an option

  • Save bbchriscesar/aa03a140b3b536f4762c21f472c42f24 to your computer and use it in GitHub Desktop.

Select an option

Save bbchriscesar/aa03a140b3b536f4762c21f472c42f24 to your computer and use it in GitHub Desktop.
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver.get("https://www.lazada.com.ph/")
wait = WebDriverWait(driver, 10)
element = wait.until(EC.element_to_be_clickable((By.XPATH, "//li[@id='Level_1_Category_No1']")))
for menu in range(len(driver.find_elements_by_xpath("//li[@class='lzd-site-menu-root-item']"))):
lazadaMenu = driver.find_elements_by_xpath("//li[@class='lzd-site-menu-root-item']")[element].text
print(menu)
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment