1 year ago

#375461

test-img

Roger Martins

Difficulty to like media (by id) with igramscraper in python

I'm trying give LIKE in some media with igramscraper (python), but I cannot do it. When I try to use instagram.like() I'm receiving the error: JSONDecodeError: Expecting value: line 1 column 1 (char 0)

One curiousity: if I do "log in" before search medias, my variable "medias" return empty. So, I do "log in" after running variable "medias".

Follow my code below:

from igramscraper.instagram import Instagram
instagram = Instagram()
medias = instagram.get_medias_by_tag(tag='investments', count=20)

instagram.with_credentials('<my_account>', '<my_password>')
instagram.login()

for media in medias:
    print(media.identifier) #only to see the media that will be liked
    instagram.like(media_id=media.identifier) #here, we have the error that I said above

I hope "to like" each media (by id) with the loop for.

python

web-scraping

instagram

instagram-api

0 Answers

Your Answer

Accepted video resources