I am trying to automate this Instagram link. I need to scroll and scroll and fetch all links. I am trying following but not working.
def fetch_links_by_hashtag(hash_tag): url = 'https://www.instagram.com/explore/tags/marketing/' driver.get(url) driver.implicitly_wait(20) is_more = False try: elem_more = wait.until(EC.element_to_be_clickable((By.PARTIAL_LINK_TEXT, "Load more"))) elem_more.click() is_more = True except Exception as ex: print(str(ex)) pop = driver.find_element_by_tag_name('footer') #pop = driver.find_element_by_link_text('About us') # pop = driver.find_element_by_class_name('_4gt3b') if pop is not None: for i in range(10): print('Calling scrolling script') # It scolls till end driver.execute_script('arguments[0].scrollTop = arguments[0].scrollHeight', pop) sleep(4) html = pop.get_attribute('innerHTML') print(html)