Search code examples
selenium-webdriverwebwebdriverweb-crawlerautofill

fill text and search on web by selenium


I would like to fill text and then enter to search some keywords in this website. i tried myself some ways but did not run, so please help me! Thanks you so much! https://shopee.vn/ enter image description here


Solution

  • You can send the text in the search box via below way, I used python to do it not sure about you as there is no code given by you, but the way remain the same.

    driver.get("https://shopee.vn/")
    
    search_box = driver.find_element_by_class_name("shopee-searchbar-input__input")
    search_box.send_keys("iphone")
    
    search_box.send_keys(Keys.ENTER)
    

    import

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

    It will be good, if you post some code, in case the above solution does not work for you.