mingrobb / usvisa-scheduler-automation

MIT License
1 stars 0 forks source link

City selection and some request #1

Open KaanTopalx opened 3 months ago

KaanTopalx commented 3 months ago

Good day, Dear @mingrobb ,

Thank you for your code, it is working like a charm. I have added some city selection to your code because in my city there is two options.

`

Get appointment date selection box

sleep(2)
driver.implicitly_wait(0.3)
try:
    city_selection_box = WebDriverWait(driver, 5).until(
        EC.presence_of_element_located((By.XPATH, "/html/body/div[4]/main/div[4]/div/div/form/fieldset/ol/fieldset/div/div[2]/div[1]/div/li/select/option[3]"))
    )        
    city_selection_box.click()
    sleep(2)        
    date_selection_box = WebDriverWait(driver, 5).until(
        EC.presence_of_element_located((By.XPATH, "/html/body/div[4]/main/div[4]/div/div/form/fieldset/ol/fieldset/div/div[2]/div[3]/label[1]"))
    )
    date_selection_box.click()

`

Option3 is 3rd one and you can change it as option2 .

Also I have a request. Is that possible to add a code for check 2 cities with same client. I mean when I start "findslot.py " it will check for 2 cities without loging out.

The client will log in and then go to appoinment page and then it will click option 2, will check for available, if possible appoinment date it will continue for reschedule. if not it will check option 3. if possible appoinment date it will continue for reschedule.

If 2 options not available, it will refresh the page without logout. ( Because login out and loging in looses time. ) Then repeat the process.

After 30/40min it will start process from beggining. From login page.

I am running two clients at the moment for checking 2 options. option2 and option3. ( option 1 is empty value ).

If you need I can share my login credentials.

KaanTopalx commented 3 months ago

Also in "clear" command it gives an error. I changed it as "cls".