0

I'm trying to use the insta-scrape library for python, specifically the method to get all posts of a instagram profile.

This is the link to the library page: https://pypi.org/project/insta-scrape/

This is the link to the library doc in particular for the method get_posts: https://instascrape.readthedocs.io/en/latest/instascrape.scrapers.html#module-instascrape.scrapers.profile

My simple code is :

options = Options()
options.add_argument('--headless')
driver = webdriver.Chrome(options=options)
insta_profile = Profile('https://www.instagram.com/molteni_matteo/')
insta_profile.scrape()
list_post = insta_profile.get_posts(webdriver=driver, amount=None,
                                      login_first=False, login_pause=60,
                                      max_failed_scroll=300, scrape=False, scrape_pause=5)
for profile_post in list_post:
    print(profile_post)

But it gives me the error :

error

How can i solve this problem ?

1 Answer 1

1

That's actually a bug in the python module, where Profile doesn't accept the url correctly. You can fix it by setting

insta_profile.url = 'https://www.instagram.com/molteni_matteo/'

before calling get_posts

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks mate. Had this issue but I get the following error: bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
You probably do need to install a parser library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.