I want to specify the beg and end dates.
I can't change the default dates, because the input boxes are read only. Or, I have to select the dates from clicking the calendar. Don't know how to do that. Is there a way to send keys to read-only input boxes?
The sources of the two input boxes are as follows:
<div class="date-from">
<h3>From</h3>
<input type="text" readonly="readonly" value="Jan 11, 2020">
<button class="icon la-Calendar"></button>
</div>
<div class="date-to">
<h3>To</h3>
<input type="text" readonly="readonly" value="Jan 11, 2020">
<button class="icon la-Calendar"></button>
</div>
My following code gets the "Message: invalid element state" error. Thank you!
browser.find_element_by_xpath('//*[@id="bpcg9kk"]/div/div[3]/div[1]/div[2]/div[1]/div[2]/div[1]/input').clear()
browser.find_element_by_xpath('//*[@id="bpcg9kk"]/div/div[3]/div[1]/div[2]/div[1]/div[2]/div[1]/input').send_keys("Jan 01,2019")
[Update] Almost there. Using the following code. The beg-date is changed successfully. The end-date has an issue. The beg-date also ends up in the end-date box.
element = browser.find_element_by_xpath('//*[@id="bpcg9kk"]/div/div[3]/div[1]/div[2]/div[1]/div[2]/div[1]/input')
browser.execute_script("arguments[0].removeAttribute('readonly','readonly')",element)
element.clear()
element.send_keys("Jan 01, 2019")
time.sleep(5)
element2 = browser.find_element_by_xpath('//*[@id="bpcg9kk"]/div/div[3]/div[1]/div[2]/div[1]/div[2]/div[2]/input')
browser.execute_script("arguments[0].removeAttribute('readonly','readonly')",element2)
element2.clear()
element2.send_keys("Dec 31, 2019")

