Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98800

Selenium Can't Get All Element on Instagram

$
0
0

I'm creating a script using Python selenium for scraping instagram user post. if user have a 62 post, I want get all of 62 post.

I tried to scroll down until all post loaded and get element/post using xpath and its works. but only 29 element/post, not all of 62 element/post.

    driver.get("https://instagram.com/celmirashop/")

    #scroll until all post loaded
    scroll()
    wait = WebDriverWait(driver, 15)
    wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "div.eLAPa")))

    time.sleep(30)

    #getting list cards of posts
    list_cards = driver.find_elements_by_xpath("//*[@class='v1Nh3 kIKUG  _bz0w']")
    print(len(list_cards))

if user have 62 post, I want get element of 62 (all) post


Viewing all articles
Browse latest Browse all 98800


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>