0
votes

I'm trying to use Selenium to search a profile in an Instagram search bar. The text gets put into the search bar fine but when i hit the Enter its goes to below url which doesn't have any details.

https://www.instagram.com/explore/search/keyword/?q=python.hub

time.sleep(5)
searchbox = driver.find_element(By.CSS_SELECTOR,"input[placeholder='Search']")
searchbox.clear()
searchbox.send_keys("python.hub")
time.sleep(5)
searchbox.send_keys(Keys.ENTER)
time.sleep(5)
searchbox.send_keys(Keys.ENTER)

enter image description here

How can i choose the profile python.hub which is shown below by using the search bar itself rather than giving the profile url directly.

enter image description here