Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
quypv-dev opened this issue Aug 29, 2022 · 0 comments

Comments

@quypv-dev
Copy link

quypv-dev commented Aug 29, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant