I am trying to input a date range using a date variable type and the command .send_keys(“inputDate”) where “inputDate” is a string value like “2020-01-02”, but even when the code run correctly, the date value inputted is totally different from the date I wanted.
I have tried to switch variable types from Str to date using “from datetime import datetime” or “import date” and I was hoping it would fix the issue, but it didn’t. I have also inspected directly the input field in the website, which is the following line:
<input class="absolute left-0 top-0 h-full w-full opacity-0" type="date" max="2024-05-29" value="2024-04-28">
and also it’s XPath:
//*[@id="__next"]/div[2]/div[2]/div[2]/div[1]/div[3]/div[2]/div[2]/div[3]/div[1]/div[1]/input
and checked if the order of input (day-month-year) was correct. Still didn’t work.
Andre Gomes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.