I used python selenium for a web project, it worked perfectly with other web elements so far, but for this one element it always returns "element not interactable: Element is not currently visible and may not be manipulated (Session info: chrome=90.0.4430.93)"
The coding of the element I want to interact is
<select id="collection-arrangement" name="collectionArrangement" class="form-control ng-dirty ng-valid-parse ng-touched ng-empty ng-invalid ng-invalid-required" required="" ng-model="Bin.CollectionArrangement" ng-change="onCollectionArrangementChange(Bin.CollectionArrangement.id)" ng-options="type as type.value for type in CollectionArrangements track by type.value" aria-invalid="true" style=""><option value="" class="" selected="selected">-- select an option --</option><option label="Site pays for collection " value="Site pays for collection " selected="selected">Site pays for collection </option><option label="Waste Service Provider purchases materials" value="Waste Service Provider purchases materials">Waste Service Provider purchases materials</option><option label="Internal bin not collected by Waste Service Provider" value="Internal bin not collected by Waste Service Provider" selected="selected">Internal bin not collected by Waste Service Provider</option></select>
My codes are
collection_arrangement = '/html/body/div/div[2]/div/section/div/div[1]/div/section/div[3]/div/div[3]/div/div[3]/section/form/table/tbody/tr[5]/td[1]/div/div/div/select'
wait = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH,collection_arrangement)))
select = Select(driver.find_element_by_id(collection_arrangement))
driver.find_element_by_xpath(collection_arrangement).click()
select.select_by_value('Internal bin not collected by Waste Service Provider')
I want to select the option "internal bin not collected by waste service provider", but every time I ran this script, the curser till hovers on the last element, which means that this element cannot be found or manipulated?
Any ideas are really appreciated!
Aucun commentaire:
Enregistrer un commentaire