1

I want to change the "trip end" date on turo rental car,this is my code:

from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
options = webdriver.ChromeOptions()
options.add_argument("--user-agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36'")
#options.add_argument("headless")
driver=webdriver.Chrome(executable_path="/home/timmy/Python/chromedriver",chrome_options=options)

url="https://turo.com/rentals/cars/co/monument/chevrolet-corvette/524782?searchId=JBjDolXY"
driver.get(url)
#do something afterchanging date

what i tried is

search=driver.find_element_by_xpath('//*[@id="pageContainer-content"]/div[4]/div[3]/div[2]/div[1]/form/div[1]/div/div/div[2]/div/div/div/div/input')
#search.setAttribute("value":"2019-03-15")
#search.send_keys('2019-03-15')
#search.setText("2019-03-15")

but nothing seems to change, i also tried search.click() it pops up the dates but can't edit,is there a way to do it without using pyautogui to click it. what i want is to select next day always(as of posting question date is 13 March so 14 March),if 14 goes to 15 and so on...

Any help is appreciated.

Amjasd Masdhash
  • 178
  • 2
  • 9
  • Your date picker is not editable so you always need to click on it and select your desire date. you can use date function like this https://stackoverflow.com/questions/3240458/how-to-increment-a-datetime-by-one-day and select your desire date. – Dhru 'soni Mar 13 '19 at 11:01
  • @Dhru'soni I can't even to change to any date. Do you mean it's only doable in `pyautogui` – Amjasd Masdhash Mar 13 '19 at 11:45
  • no you don't need to use pyautogui. you can do without it. – Dhru 'soni Mar 13 '19 at 12:09

0 Answers0