I am trying to fill the Uber form using selenium.
It looks like this:
I tried to use XPath
to fill the form, here is the code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument("user-data-dir=C:\\Users\\Zedas\\AppData\\Local\\Google\\Chrome\\User Data")
w = webdriver.Chrome(executable_path='chromedriver.exe', chrome_options=options)
w.get("https://m.uber.com/looking")
time.sleep(6)
w.get_element_by_xpath(f'"//*[@id="booking-experience-container"]/div/div[3]/div[2]/div/input"').send_keys("test")
But, this is the error:
w.get_element_by_xpath(f'"//*[@id="booking-experience-container"]/div/div[3]/div[2]/div/input"').send_keys("test")
AttributeError: 'WebDriver' object has no attribute 'get_element_by_xpath'
How can this error be fixed?