skip to Main Content

Navigate in JSON with nultiple keys

I'm trying to get a key from a JSON from a website using the following code: import json import requests from bs4 import BeautifulSoup url = input('Enter url:') html = requests.get(url) soup = BeautifulSoup(html.text,'html.parser') data = json.loads(soup.find('script', type='application/json').text) print(data) print("####################################")…

VIEW QUESTION

how to merge two json data by mapping

I have two json datas as json_1 = [{'purchasedPerson__id': 2, 'credit': 3000}, {'purchasedPerson__id': 4, 'credit': 5000}] json_2 = [{'purchasedPerson__id': 1, 'debit': 8526}, {'purchasedPerson__id': 4, 'debit': 2000}] i want to merge both the json and needed optput as json_final = [{'purchasedPerson__id':…

VIEW QUESTION

Json – Ansible loop with array

Could someone let me know how we can create a code as below? - name: TEST1 set_fact: list_a: "{{ list_a + [item.json.SearchResult.resources] }}" with_items: - "{{ source_list.results[0] }}" - "{{ source_list.results[1] }}" - "{{ source_list.results[x] }}" ... (unknown how many…

VIEW QUESTION

JSONPath to get multiple values

Let's assume that we have the below code { "tasks": [ { "id": "task_1", "name": "task_1_name", "assignees": [ { "id": "assignee_1", "name": "assignee_1_name" } ] }, { "id": "task_2", "name": "task_2_name", "assignees": [ { "id": "assignee_2", "name": "assignee_2_name" }, {…

VIEW QUESTION
Back To Top
Search