How to write date and current time in Selenium

Asked

Viewed 20 times

0

I would like to know how to include the current date in PT/BR format as in the example: 21/07/2021 and a specific date such as: 01/01/2020

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from datetime import datetime

navegador.find_element_by_xpath('//*[@id="ctl00_Periodo_drpPeriodo"]').click()
navegador.find_element_by_xpath('//*[@id="APeriodoDigitar"]').click()
navegador.find_element_by_xpath('//*[@id="ctl00_Periodo_txtPeriodoDataInicial"]').(quero digitar aqui a data!)
  • Where will this date come from? From datetime ?

  • 1

    datetime.datetime.now().strftime("%d/%m/%Y") ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.