![]() I don't think you will be able anycodings_instagram-api to get that information without using anycodings_instagram-api something like Selenium, which can anycodings_instagram-api load/render the javascript that displays anycodings_instagram-api the followers to the user. anycodings_instagram-api Rather, Instagram AJAXs in the anycodings_instagram-api information to the page source (using anycodings_instagram-api React?) after you click the Followers anycodings_instagram-api button. The followers endpoint isn't really a anycodings_instagram-api RESTful endpoint from what I can tell. The anycodings_instagram-api media endpoint appears to be a REST API, anycodings_instagram-api configured to return an easily parseable anycodings_instagram-api JSON object. Regardless, anycodings_instagram-api /instagram/media/ is not anycodings_instagram-api the same type of endpoint as anycodings_instagram-api /instagram/followers. What are you currently anycodings_instagram-api using to scrape and paginate? For instance, I'm not really anycodings_instagram-api sure what "from which I can scrape and anycodings_instagram-api paginate through all iterations" anycodings_instagram-api actually means. Your question is a little anycodings_instagram-api confusing. I did a quick benchmark to show how anycodings_instagram-api performance decreases exponentially the anycodings_instagram-api more followers you attempt to scrape anycodings_instagram-api this way: $ python example.py # In this instance, I'm using a generator to return followers one-by-oneįollower_css = "ul div li:nth-child(".format(count, follower)) # Keep scrolling in a loop until you've hit the desired number of followers. # Now the modal will begin loading followers every time you scroll to the bottom. # model by scrolling up and down, you can force it to load additional followers for # you hit a stopping point and a "See All Suggestions" link. # At this point a Followers modal pops open. ![]() # driver.find_element_by_partial_link_text("follower").click() Waiter.find_element(driver, People']", by=XPATH) # Wait for the user dashboard page to load ![]() Waiter.find_element(driver, by=XPATH).click() Waiter.find_write(driver, password, by=XPATH) Waiter.find_write(driver, username, by=XPATH) Note that to use this updated script, anycodings_instagram-api you must install the explicit package anycodings_instagram-api (pip install explicit), or convert each anycodings_instagram-api line with waiter to a pure selenium anycodings_instagram-api explicit wait. Here is an updated anycodings_instagram-api script that is a bit more pythonic and anycodings_instagram-api better utilizes XPATH/CSS paths. Things have changed in Insta land since anycodings_instagram-api this was posted. I would like to do something anycodings_selenium similar with the list of followers, and anycodings_selenium access this data directly (rather than using anycodings_selenium Selenium). But do anycodings_selenium I have to use a package like Selenium? Does anycodings_selenium anyone know what the underlying URL is, so I anycodings_selenium don't have to use Selenium?Īs an example, I am able to directly access anycodings_selenium the underlying feed data by visiting anycodings_selenium "/instagram/media/", from which anycodings_selenium I can scrape and paginate through all anycodings_selenium iterations. Since it appears on my browser window, I anycodings_selenium assume that I will be able to scrape. I note that the URL changes to anycodings_selenium "" anycodings_selenium when this window pops up, but I can't seem anycodings_selenium to view the underlying page source for this anycodings_selenium URL. The Instagram web browser allows you to view anycodings_selenium the follower list for any given public user anycodings_selenium - for example, to view Instagram's anycodings_selenium followers, visit anycodings_selenium "", and anycodings_selenium then click on the followers URL to open a anycodings_selenium window that paginates through viewers (note: anycodings_selenium you must be logged in to your account to anycodings_selenium view this). Can anyone tell me how to access the anycodings_selenium underlying URL to view a given user's anycodings_selenium Instagram followers? I am able to do this anycodings_selenium with Instagram API, but given the pending anycodings_selenium changes to the approval process, I have anycodings_selenium decided to switch to scraping.
0 Comments
Leave a Reply. |