API conexion problem

Posted over 3 years ago by taxi_taxi

Post a topic
Un Answered
t
taxi_taxi

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)

0 Votes


1 Comments

j

jeanfrancois_allot posted over 3 years ago

Hello,


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


/JF

0 Votes

Login to post a comment