Now let's look at how to connect to Elastic Cloud using the Elasticsearch Python library.
Connecting to the Elastic Cloud cluster with Python
Getting ready
The code for this recipe is in the 11/01/elasticcloud_starwars.py script. This script will scrape Star Wars character data from the swapi.co API/website and put it into the Elastic Cloud.
How to do it
We proceed with the recipe as follows:
- Execute the file as a Python script:
$ python elasticcloud_starwars.py
- This will loop through up to 20 characters and drop them into the sw index with a document type of...