# Sample code for writing file contents to ES index with ES Python API

**URL:** <https://discuss.elastic.co/t/sample-code-for-writing-file-contents-to-es-index-with-es-python-api/33687>\
**Category:** Elasticsearch\
**Created:** [November 4, 2015, 12:37am UTC](https://discuss.elastic.co/t/sample-code-for-writing-file-contents-to-es-index-with-es-python-api/33687 "2015-11-04T00:37:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pstarrett1](https://avatars.discourse-cdn.com/v4/letter/p/779978/32.png) [@pstarrett1](https://discuss.elastic.co/u/pstarrett1)\
**Post date:** [November 4, 2015, 12:37am UTC](https://discuss.elastic.co/t/sample-code-for-writing-file-contents-to-es-index-with-es-python-api/33687/1 "2015-11-04T00:37:16Z")

</div>

I would like to use the ES Python API to write results of web scrape (text only) to an ES index as a document. I wonder if anyone knows of sample code they can point me to (or provide as reply to this post). All I really need is more specifics ton how o use the es.get() method to place the HTML into the es.get() call successfully. I have reviewed the ES Python API documentation but not finding what I need. Thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:40pm UTC](https://discuss.elastic.co/t/sample-code-for-writing-file-contents-to-es-index-with-es-python-api/33687/2 "2017-07-05T23:40:46Z")

</div>


