Reputation: 193
i have been scraping from website since yesterday but the submit button wont work with click.
this is the code
button = driver.find_element_by_id('ctl00_PlaceHolderMain_g_6c89d4ad_107f_437d_bd54_8fda17b556bf_ctl00_btnSearch2').click()
this is element from the website
<input type="submit" name="ctl00$PlaceHolderMain$g_6c89d4ad_107f_437d_bd54_8fda17b556bf$ctl00$btnSearch2" value="Cari" onclick="SetSource(this.id);" id="ctl00_PlaceHolderMain_g_6c89d4ad_107f_437d_bd54_8fda17b556bf_ctl00_btnSearch2" class="btn btn-primary" autopostback="True" style="margin-top: 31px">
the error
ElementNotInteractableException: Message: element not interactable
(Session info: chrome=87.0.4280.141
website link : https://www.bi.go.id/id/statistik/informasi-kurs/transaksi-bi/Default.aspx Cari BUTTON i hope you can understand my question!thank you in advance
Upvotes: 0
Views: 482
Reputation: 2237
Try this.
time.sleep(5)
buttons = driver.find_elements_by_xpath("//input[@value='Cari']")
This returns 2 buttons. Choose the one you want.
buttons[0].click()
#First button..Currency selector?
buttons[1].click()
#Second Button..Date selector.
To check elements. Open the developer console. press CTRL+F. In the bar type the xpath
. It will highlight the element and show how many are there with the same attribute.
Upvotes: 1
Reputation: 19989
WebDriverWait(driver, 15).until(EC.element_to_be_clickable(
By.xpath, "//input[@id='ctl00_PlaceHolderMain_g_6c89d4ad_107f_437d_bd54_8fda17b556bf_ctl00_btnSearch2']"))
Could you try explicit wait
Upvotes: 0