The problem is how can i use send_keys? Because it is not writing in the search bar.
I search in the documents but i can't solve it.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time
# Open Chrome
driver = webdriver.Chrome('C:/xampp/htdocs/pegasus/chromedriver')
# Going to website
driver.get("https://www.flypgs.com/en")
# Select button by class name and click on it.
frombtn = driver.find_element_by_class_name('select2-selection').click()
searchbtn = driver.find_element_by_class_name("select2-search__field").click()
# ERROR is here below on send_keys.
searchbtn.send_keys('Amsterdam')
time.sleep(1000000)
The error what is giving is:
Exception has occurred: AttributeError
'NoneType' object has no attribute 'send_keys'
File "C:\xampp\htdocs\pegasus\app.py", line 17, in <module>
searchbtn.send_keys('Amsterdam')