Jul-24-2022, 07:26 AM
Ok if it like that can use Requests,the curl command would be like this in Requests.
import requests response = requests.get('http://118.31.106.59:9200/_cat/indices') print(response.text.strip()) # Parse out ip ip = response.url.split('/')[2] print(ip)
Output:green open .geoip_databases vtWge-U1SLefV6CuavYxCQ 1 0 40 40 37.7mb 37.7mb
118.31.106.59:9200