-1

I'm using python with selenium and it doesn't find the dropdown. I don't have a Select tag in DOM. Any ideas ?

P.S the developers added DATA QA for me

Here is the relevant HTML :

<div class="MuiGrid-root contact-us-styles__StyledGridContainerForTextFields-sc-1xqduqn-8 dSYioi MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-12 MuiGrid-grid-md-12">
  <div>
    <label class="MuiFormLabel-root MuiInputLabel-root InputLabel__StyledInputLabel-sc-1ryqn8h-0 hUmuWj MuiInputLabel-animated" for="component-simple">Bitte wählen Sie Ihre Bestellart aus *</label>
    <div class="MuiFormControl-root Dropdown__StyledFormControl-sc-u37r21-0 JRpKK" sx="[object Object]">
      <div class="MuiInputBase-root MuiOutlinedInput-root Dropdown__StyledSelect-sc-u37r21-1 gBjzLJ MuiInputBase-formControl">
        <div class="MuiSelect-root MuiSelect-select MuiSelect-selectMenu MuiInputBase-input MuiOutlinedInput-input" tabindex="0" role="button" aria-haspopup="listbox">
          <span>&ZeroWidthSpace;</span>
        </div>
        <input aria-hidden="true" tabindex="-1" class="MuiSelect-nativeInput" data-qa-id="orderType" value="">
        <svg class="MuiSvgIcon-root MuiSelect-icon" focusable="false" viewBox="0 0 24 24" aria-hidden="true">
          <path d="M7 10l5 5 5-5z"></path>
        </svg>
        <fieldset aria-hidden="true" class="PrivateNotchedOutline-root-150 MuiOutlinedInput-notchedOutline" style="padding-left: 8px;">
          <legend class="PrivateNotchedOutline-legend-151" style="width: 0.01px;">
            <span>&ZeroWidthSpace;</span>
          </legend>
        </fieldset>
      </div>
    </div>
  </div>
</div>
Segfam
  • 23
  • 3
  • Update the question with code that you've tried, screenshot of the drop down and error if there's any. – cruisepandey Dec 06 '21 at 09:51
  • better show URL for this page and minimal working code. You didn't show how you try to get it so we can't see if you do it correctly - and original HTML may have other problems - like `iframe` - and our solution for this part of code may not work for full page. – furas Dec 06 '21 at 10:25

1 Answers1

0

P.S the developers added DATA QA for me

Then you should be able to use attribute selector like

input[data-qa-id]

Please launch JavaScript console in your browser and check if

document.querySelector("input[data-qa-id]")

does get what you want. If yes then it should also work with selenium's find_element_by_css_selector

Daweo
  • 31,313
  • 3
  • 12
  • 25
  • When i search the element via the DOM with "document.querySelector("input[data-qa-id]")" it finds it BUT in the Pycharm it doesn't... – Segfam Dec 06 '21 at 12:26
  • @Segfam it only confirm that you should show URL for this page so we could see full HTML. – furas Dec 06 '21 at 14:50