Learn all about the latest trends and best practices in data extraction - Join us at Extract SummitGet tickets
Start a new topic

API conexion problem

Hello,


I would like to use scrapy cloud in python but I can't connect to the API.


I receive this error message:

{'type': 'http://errors.xod.scrapinghub.com/unauthorized.html', 'title': 'Authentication token not provided or invalid'}


I used the code provided on your website to test:

https://docs.zyte.com/automatic-extraction-integrations.html


xxxxxxxxxxxxxxxx is my API key.


Do I have to fill the second field in author?


Many thanks for your help


import requests as rq
response = rq.post(
'https://autoextract.scrapinghub.com/v1/extract',
auth=('[xxxxxxxxxxxxxxxxxxxxxxxxxxx]', ''),
json=[
{'url': 'http://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html', 'pageType': 'product'}])
results = response.json()
print(results)
1 Comment

Hello,


Did you try the key available under your Zyte profile: https://app.zyte.com/account/apikey  ?


/JF

Login to post a comment