Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send Keys Error?
#1
Hey I have not been able to send date from the drop list in this website:

Here is my code:
1.Even if I .click(), it shows error
Error:
NoneType has no attribute click
2.When I also add .clear(), it shows error
Error:
NoneType has no attribute clear
3. time.sleep(10) doesnt help

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

browser = webdriver.Chrome()

url = 'https://www.sharesansar.com/floorsheet'
browser.get(url)
time.sleep(5)

date=['2020-10-03']
#Inputing company name and date
input_name=browser.find_element_by_xpath('/html/body/div[1]/div/section[2]/div[3]/div/div/div/div/div[1]/form/div[1]/span/span[1]/span/span[1]').click()
input_name2=browser.find_element_by_xpath('/html/body/span/span/span[1]/input')
input_name2.send_keys(company_name)
input_name2.send_keys(Keys.RETURN)

input_date=browser.find_element_by_xpath('/html/body/div[1]/div/section[2]/div[3]/div/div/div/div/div[1]/form/div[2]/input')
input_date.click()
input_date.clear()
input_date.send_keys(date)
input_date.send_keys(Keys.RETURN)
button_search=browser.find_element_by_xpath('/html/body/div[1]/div/section[2]/div[3]/div/div/div/div/div[1]/form/div[5]/button').click()
time.sleep(5)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [flask] mail.send giving error SheeppOSU 2 2,831 May-31-2019, 09:31 PM
Last Post: SheeppOSU
  How to send keys at beginning of textbox using python Prince_Bhatia 2 3,023 May-21-2018, 08:15 AM
Last Post: Prince_Bhatia

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020