Issue
Can anyone help me with the Selenium webdriver (in Python) code to automatically select a date in the input date in the above link.
https://www.nseindia.com/products/content/derivatives/equities/archieve_fo.htm
It is just one line of code but I've wasted hours behind it. someone please kindly help. I've tried the .send_keys() function and have searched for hours about the datepicker issue. Kindly help.
Solution
You havn't mentioned exactly where you are stuck while automatically sending a date in the <input>
tag. How ever the <input>
tag is having type as text and the following code block works perfect :
Code Block :
from selenium import webdriver driver=webdriver.Firefox(executable_path=r'C:\path\to\geckodriver.exe') driver.get("https://www.nseindia.com/products/content/derivatives/equities/archieve_fo.htm") print("Page Title is : %s" %driver.title) driver.find_element_by_xpath("//input[@class='textboxdata hasDatepicker' and @id='date']").send_keys("10-04-2018")
Console Output :
Page Title is : NSE - National Stock Exchange of India Ltd.
Snapshot :
References
You can find a couple of relevant detailed discussion in:
Answered By - DebanjanB
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.