# 获取当前时间字符串
now = datetime.now()
three = now - timedelta(days=3)
ago = three.strftime("%Y-%m-%d")
date = now.strftime("%Y-%m-%d")
print(ago,date)
input_start = driver.find_element(By.XPATH,' ')
input_start.click()
# 使用JavaScript将输入光标移动到最前面
driver.execute_script("arguments[0].setSelectionRange(0, 0)", input_start)
input_start.send_keys(ago)
input_start.send_keys(Keys.ENTER)
time.sleep(5)
input_end = driver.find_element(By.XPATH,' ')
input_end.click()
# 使用JavaScript将输入光标移动到最前面
driver.execute_script("arguments[0].setSelectionRange(0, 0)", input_end)
input_end.send_keys(date)
input_end.send_keys(Keys.ENTER)
time.sleep(5)
修改日期为3天前到当前时间
最新推荐文章于 2024-11-11 21:30:41 发布