Untitled

mail@pastecode.io avatar
unknown
plain_text
6 days ago
600 B
2
Indexable
Never
from iniciar_driver import iniciar_driver
from selenium.webdriver.common.by import By
import time
from selenium.webdriver.support.select import Select
import random


driver=iniciar_driver()

driver.get('https:cursoautomacao.netlify.app/desafios.html')
time.sleep(1)
driver.execute_script("window.scrollBy(0,2200)")
time.sleep(1)
paises_dropdown = driver.find_element(By.XPATH, "//select[@id='paisesselect']")
opcoes = Select(paises_dropdown)
opcoes.select_by_index(2)
time.sleep(1)
opcoes.select_by_value('africa')
time.sleep(1)
opcoes.select_by_visible_text('Chille')
input(' ')
Leave a Comment