0

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

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

thank you but it still wont work..error : type object 'By' has no attribute 'xpath'
It's in the capitals. XPATH
its still the same..error : ---> 80 raise TimeoutException(message, screen, stacktrace) the message just blank tho
Although, it is advisable to use WebDriverWait, sometimes, it just doesn't work. I use time.sleep(x) ..then find the element with the same xpath, the regular way. driver.find_element_by_xpath.
so the other element has the same xpath? woah i didnt know that bcs im actually very new with scraping thing,do you mind to tell me how to check that?
0
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

2 Comments

You are sure there is only.one element with that locator ?
yeah..this is the link if you have time to check bi.go.id/id/statistik/informasi-kurs/transaksi-bi/Default.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.