[Python] Choose month from drop down using selenium controlled Mozilla on python

Discussão em 'Python' iniciado por Stack, Junho 20, 2025.

  1. Stack

    Stack Membro Participativo

    I want to make an automated Gmail account creator. For some reason, I am not being able to web driver to click on the month and choose a month to proceed with the creation.I'm using an earlier version of selenium(2.4) and Firefox(25) because of having problems with gecko driver.

    <label id="month-label" class="month">

    <span id="BirthMonth" class=" form-error" aria-invalid="true">
    <div class="goog-inline-block goog-flat-menu-button jfk-select" role="listbox" style="-moz-user-select: none;" aria-expanded="false" tabindex="0" aria-haspopup="true" title="Birthday" aria-activedescendant=":0">
    <div id=":0" class="goog-inline-block goog-flat-menu-button-caption" role="option" aria-setsize="12" aria-posinset="0"> … </div>
    <div class="goog-inline-block goog-flat-menu-button-dropdown" aria-hidden="true"> … </div>
    </div>
    <input id="HiddenBirthMonth" type="hidden" name="BirthMonth"></input>
    </span>

    </label>


    I have filled all of the earlier fields which didn't require a dropdown.

    birthelem2=(browser.find_element_by_id('BirthMonth'))
    birthelem2.click()
    month=browser.find_elements_by_class_name('goog-menuitem-content')
    month[0].click()


    I expect it to choose a month(January)

    Continue reading...

Compartilhe esta Página