I want to parse following JSON with IPs and its counts into a single list containing only IPs using Python.
& code: `
response_ips= requests.get(url=link_getResults,headers=payload)
response_ips.raise_for_status()
data_ips= json.loads(response_ips.text)
results=data_ips['results']
print results
Split the results on \r\n to get each line, then split each of those on \t to separate the IP from the count.
ips = [line.split("\t")[0] for line in results.split("\r\n")]
print(ips)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With