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
531 stars 61 forks source link

Error: Wrong response content type! Received: text/html; charset=utf-8 Expected: application/json #72

Open quypv-dev opened 1 year ago

quypv-dev commented 1 year ago

Initially I used it normally nothing happened. After 1 day I turn it on and use it again it gives an error. Hope anyone can help me to fix this error.

`const express = require('express') const app = express() const port = 3333 const instaTouch = require('instatouch');

app.get('/', (req, res) => { res.send('Hello World!') })

app.get('/posts', async(req, res) => { const hashtag = 'playstation'; const result = await getPostsByHashtag(hashtag); res.send(result) })

app.listen(port, () => { console.log(Example app listening at http://localhost:${port}) })

async function getPostsByHashtag(hashtag) { // Scrape 100 video posts from the hashtag feed try { const options = { count: 10}; const result = await instaTouch.getUserMeta(hashtag, options); console.log(result); return result; // the result object has a 'collector' property (array), that contains the posts } catch (error) { console.log(error); }

}`

Error:` Wrong response content type! Received: text/html; charset=utf-8 Expected: application/json at Promise (/home/vanquy/Desktop/learn-cheerio/node_modules/instatouch/build/core/InstaTouch.js:97:27)