{“messages”:“The API is unreachable, please contact the API provider”, “info”: “Your Client (working) —> Gateway (working) —> API (not working)”}
I’ve tried several times through the requests and httpx lib ,but it was still unreachable.
아래에 의견을 추가하고 토론에 참여하세요.
From your logs, I see you sometimes send “header” as a non-array (string) instead of “headers” and array ([])
For search engines like google.com and baidu I also recommend to provide “geo” : “ru” like this:
{
“url”: “https://www.google.com”,
“geo”: “ru”,
“headers”: [
“X-Header: some-random-header”
]
}
it’s still not working…is there something wrong with my code?
import requests
url = “https://scrapeninja.p.rapidapi.com/scrape”
payload = {
“url”: “https://www.google.com/”,
“header”: [
“X-Header: some-random-header”
]
}
headers = {
‘content-type’: “application/json”,
‘x-rapidapi-host’: “scrapeninja.p.rapidapi.com”,
‘x-rapidapi-key’: “###”
}
response = requests.request(“POST”, url, data=payload, headers=headers)
print(response.text)
hi! I see 502 for your requests but I can’t reproduce it while scraping the same website… apparently this was website or proxies downtime. Can you try again please and let me know?