0

I am trying to change a date one day forward on a calendar date picker using python and selenium.

<td colspan="2" class="textBlack">&nbsp;Due:&nbsp;
                                            <input type="text" id="CurdtDate" name="CurdtDate" value="2/18/2020" size="8" maxlength="10" class="textBoxColor textBoxText date hasDatepicker" tabindex="6"><img class="ui-datepicker-trigger" src="/evo2/fresh/eLead-V45/elead_track/images/icons/icon_calendar_datepicker.gif" alt="..." title="...">
                                            <!--CanBackDate:unknown--><!--CanBackDate:[False]--><script type="text/javascript">var dpDueDate_DatePicker = new DatePicker("#CurdtDate", "#", "#", false, "MM/dd/yyyy", "mm/dd/yy", "/evo2/fresh/eLead-V45/elead_track/images/icons/icon_calendar_datepicker.gif", "2/19/2020", "01/01/2079", false, false, false, true, 0, false); $(document).ready(function() { dpDueDate_DatePicker.Configure(); });</script>
                                            &nbsp;&nbsp; Hrs:
                                            <select name="nHrs" class="dropDownListColor dropDownListText" tabindex="7">
                                                <option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12" selected="">12</option>
                                            </select>
                                            &nbsp;&nbsp; Min:
                                            <select name="nMin" class="dropDownListColor dropDownListText" tabindex="8">
                                                <option selected="" value="0">00</option><option value="15">15</option><option value="30">30</option><option value="45">45</option>
                                            </select>
                                            &nbsp;&nbsp; AM/PM:
                                            <select name="szAMPM" class="dropDownListColor dropDownListText" tabindex="9">
                                                <option selected="" value="AM">AM</option><option value="PM">PM</option>
                                            </select>
                                        </td>

My Code using Selenium and python:

driver.find_element_by_css_selector('img.ui-datepicker-trigger')
calendar = driver.find_element_by_css_selector('img.ui-datepicker-trigger')

calendar = WebDriverWait(driver, 5).until(
    EC.element_to_be_clickable((By.CSS_SELECTOR, 'img.ui-datepicker-trigger')))
calendar.click()

Any help is much appreciated!

2
  • It will be good if the website screenshot is posted Feb 20 '20 at 8:03
  • What are you trying to do and what is the issue here?.The code shows that you are clicking an image element?. input#curdtDate for typing the input
    – PDHide
    Feb 20 '20 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.