I'm trying to access click a hashtag on Instagram with Selenium, so I can see all images related to that hashtag.
The problem is, that the hashtag, which you are searching for is not always on the top... Is there a way to find and click the hashtag I am searching for?
Would be cool if you could help me :)
def likeByHashtag(self,hashtag):
#click on the magnifying glass
element = WebDriverWait(driver, 60).until(EC.element_to_be_clickable((By.XPATH, "/html/body/div[1]/div/div/section/nav[2]/div/div/div[2]/div/div/div[2]/a")))
element.click()
#type in searchbar
element = WebDriverWait(driver, 60).until(EC.presence_of_element_located((By.XPATH, "/html/body/div[1]/div/div/section/nav[1]/div/header/div/h1/div/div/div/div[1]/label/input")))
element.send_keys("#" +hashtag)
#click on #
element = xxx