GithubHelp home page GithubHelp logo

Question about instascrape HOT 2 CLOSED

chris-greening avatar chris-greening commented on May 25, 2024
Question

from instascrape.

Comments (2)

chris-greening avatar chris-greening commented on May 25, 2024

Hello!

That's a feature I've been planning but haven't gotten around to yet; I just went and looked at the JSON served back from a post with multiple images and it is certainly possible to scrape. I'll bump this to the top of the priority list and have it released sometime in the next few days as a new feature with the next minor version release!

In the meantime, when you want URL's for every image in the post you can use this function:

def get_image_urls(post):
    """Returns a list of URLs for all images in a scraped Post object"""
    image_urls = {key: val for key,val in post.flat_json_dict.items() if "display_url" in key} 
    return list(set(image_urls.values()))

Scrape a post like you normally would and then pass it as an argument to get_image_urls, this will return a list of all the URLs in the post.

Hope this helps!

from instascrape.

Matteoo98 avatar Matteoo98 commented on May 25, 2024

Thank you very much you helped me a lot

from instascrape.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.