drawrowfly / instagram-scraper

Instagram Scraper. Scrape useful data/posts from instagram users, hashtag and locations pages. Comments and people who liked specific posts and soon more. No login or API keys are required
568 stars 62 forks source link

Date error on getting posts #12

Closed vivek-hb closed 4 years ago

vivek-hb commented 4 years ago

When I get posts based on username I get the following error InstaTouch Scraper StartedError: Can't scrape date. Please try again or submit issue to the github. Kindly look into this issue.

anurastogi commented 4 years ago

When I get posts based on username I get the following error InstaTouch Scraper StartedError: Can't scrape date. Please try again or submit issue to the github. Kindly look into this issue.

I am facing the same error on my production environment - Ubuntu 16.04.5. Though it is working on my local Windows machine. Please guide.

drawrowfly commented 4 years ago

You need to use session value. Between june 2-5 IG has changed something and it can detect non residential IP and will require from you to be logged in. If you are using it as module you can set session id value through option session

Login to your IG in browser->open inspector->network->choose any request to the IG and look for value in cookies that is starting with sessionid

In scraper set option session: "sessionid=BLABLALBA"

anurastogi commented 4 years ago

You need to use session value. Between june 2-5 IG has changed something and it can detect non residential IP and will require from you to be logged in. If you are using it as module you can set session id value through option session

Login to your IG in browser->open inspector->network->choose any request to the IG and look for value in cookies that is starting with sessionid

In scraper set option session: "sessionid=BLABLALBA"

I tried this piece of code

 const options = { count: 20,session: "sessionid=GOT_FROM_COOKIES" };
 const user = await instatouch.user(_profileName_, options);

However, I am still getting the same error on the Ubuntu machine. On Windows , its working well. Anything I am missing?

anurastogi commented 4 years ago

On the Terminal, the hashtag, comments, likers options are working. It is only the "user" option which is giving the error.

drawrowfly commented 4 years ago

Because if you are not authorized to the IG in the browser and will visit any IG Profile in the browser by using proxy or spammed IP, IG will ask for you to sign in to your account

drawrowfly commented 4 years ago

It is a new form of protection. You can use valid session value(preferably more then 1) and it will work fine.

I will check on it later, maybe there is another way

danarenepotter commented 4 years ago

I am on a Mac and "In scraper set option session: "sessionid=BLABLALBA" " worked to fix this bug for me! Thanks much