No recent searches
Popular Articles
Sorry! nothing found for
Posted about 2 years ago by Sarath CM
const data = JSON.stringify([{
'url': 'http://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html',
'pageType': 'product',
}]);
const options = {
host: 'autoextract.scrapinghub.com',
path: '/v1/extract',
headers: {
'Authorization': 'Basic ' + Buffer.from('api_key_from_created_account').toString('base64'),
'Content-Type': 'application/json',
'Content-Length': data.length
},
method: 'POST',
};
const req = https.request(options, res => {
console.log(`statusCode: ${res.statusCode}`)
res.on('data', d => {
process.stdout.write(d)
})
});
req.on('error', error => {
console.error(error)
req.write(data);
req.end();The same sample code is used but shows "Authentication token not provided or invalid". Using API key from Settings-> API key
1 Votes
1 Comments
Sandra Menon posted over 1 year ago
Faced the same issue
0 Votes
Login to post a comment
People who like this
This post will be deleted permanently. Are you sure?
const data = JSON.stringify([{
'url': 'http://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html',
'pageType': 'product',
}]);
const options = {
host: 'autoextract.scrapinghub.com',
path: '/v1/extract',
headers: {
'Authorization': 'Basic ' + Buffer.from('api_key_from_created_account').toString('base64'),
'Content-Type': 'application/json',
'Content-Length': data.length
},
method: 'POST',
};
const req = https.request(options, res => {
console.log(`statusCode: ${res.statusCode}`)
res.on('data', d => {
process.stdout.write(d)
})
});
req.on('error', error => {
console.error(error)
});
req.write(data);
req.end();
The same sample code is used but shows "Authentication token not provided or invalid". Using API key from Settings-> API key
1 Votes
1 Comments
Sandra Menon posted over 1 year ago
Faced the same issue
0 Votes
Login to post a comment