从无法访问的 JsonObject() 中提取数据 [英] Extract data from an unreachable JsonObject()

查看:49
本文介绍了从无法访问的 JsonObject() 中提取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 JsObject 来抓取它.

I'm trying to reach a JsObject to scrape it.

import requests
from bs4 import BeautifulSoup

url ='https://fjrgcwbcbo-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%20(lite)%203.27.0%3Binstantsearch.js%202.8.0%3BJS%20Helper%202.26.0&x-algolia-application-id=FJRGCWBCBO&x-algolia-api-key=a214a1e7afd822b517723830f05e9449'
jsonObj = requests.get(url).json()

print(JsonObj)

此 URL 中有四个 JsonObject,但每个似乎都被 API 阻止了.网站网址

There are four JsonObject from this URL, but each one seems to be blocked by an API. Website URL

非常感谢.

推荐答案

我找到了另一种解决方案,可以一次性清除所有电子邮件地址.

I find another solution to scrap all of the email adresses in one shot.

import requests
import json
from algoliasearch import algoliasearch

url ='https://fjrgcwbcbo- 
dsn.algolia.net/1/indexes/*/queries'

client = algoliasearch.Client("FJRGCWBCBO", "a214a1e7afd822b517723830f05e9449")
index = client.init_index('CAPI-agents-stage')

for hit in index.browse_all({"query": ""}):
print(hit['email_address'])

如果它可以帮助任何人,非常感谢Chitown88

If it could help anyone, thanks a lot Chitown88

这篇关于从无法访问的 JsonObject() 中提取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆