So I've been working with Selenium in Python. I finished my code (which worked at the time) but suddenly it chose not to work anymore. To be specific: If I try:
driver.find_element_by_id("leasingtrue").click()
It returns me the error:
selenium.common.exceptions.ElementNotInteractableException: Message: Element <input id="leasingfalse" name="IsLeasing" type="radio"> could not be scrolled into view
On the other hand, if I find the element by its XPath it works like intended. The error only occurs with type "radio" but consistently at every single one.
Since the complete code is about 600 lines long I don't intend to change every single one of these to an XPath. Another relevant information: Since I am working with PyCharm I could just revert back to a version that definitely worked before. But now, it gives me the same error as well. Does anyone have a clue to what this error could be related to?
The website I am scraping is: https://www.comparis.ch/autoversicherung/berechnen?carmake=41. I'm using Python 2.7 with Selenium 3.8 The relevant HTML is:
<div class="item-selectable xsmall-6 columns">
<input data-val="true" data-val-required="Bitte wählen Sie eine Antwort aus." data-vertical-alignment="middle" id="leasingtrue" name="IsLeasing" type="radio" value="true" aria-required="true" aria-invalid="false" aria-describedby="IsLeasing-error">
<label for="leasingtrue">Ja</label>
</div>