No recent searches
Popular Articles
Sorry! nothing found for
Posted about 5 years ago by techytimo
I am trying to extract content from a url with php.
$curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'APIKEY: myapikeymyapikey' ], CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'https://autoextract.scrapinghub.com/v1/extract', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => [ 'url' => 'https://blog.scrapinghub.com/gopro-study', 'pageType' => 'article' ] ]); $resp = curl_exec($curl); curl_close($curl); return $resp;
I get the error
{
title: "No authentication token provided",
type: "http://errors.xod.scrapinghub.com/unauthorized.html"
}
0 Votes
nestor posted about 5 years ago Admin Best Answer
Try:
CURLOPT_POSTFIELDS => json_encode([[ 'url' => 'https://blog.scrapinghub.com/gopro-study', 'pageType' => 'article' ]])
15 Comments
Login to post a comment
People who like this
This post will be deleted permanently. Are you sure?
I am trying to extract content from a url with php.
I get the error
{
title: "No authentication token provided",
type: "http://errors.xod.scrapinghub.com/unauthorized.html"
}
0 Votes
nestor posted about 5 years ago Admin Best Answer
Try:
0 Votes
15 Comments
Login to post a comment