Hello !
Greetings !
We are newbies in the Elasticsearch and we are currently fumbling over the following issue.
Objective : We are trying to fetch the json formatted files from a particular website and then use Elasticsearch to store and later search these files. These files will be dynamically generated with a fixed frequency. We have a Python script to call the files from the desired web site.
Issue: as we need the called files in the json files , we are trying to define the content Type in the python script but we are unable to do so.
Following is the code in Pythn , could you please give us some feedback on how to define the content type here ?
import elasticsearch
import simplejson as json
import requests
from elasticsearch import helpers
from bs4 import BeautifulSoup
import pandas as pd
from stringify import stringify_py
es = elasticsearch.Elasticsearch([{'host':'127.0.0.1', 'port':9200}])
res = requests.get('http://127.0.0.1:9200')
print(res.content)
r = requests.get("https://coinmarketcap.com/currencies/ripple/#markets")
soup = BeautifulSoup(r.content, "lxml")
table = soup.find_all('table')[0]
df = pd.read_html(str(table))
data = df[0].to_json(orient = 'records')
es.index(index='test', doc_type='people', id=1, body=data)
Thanks ,
Rohit