Skip to main content

Python - Flask Frontend to generate Elasticsearch Docs from Sitemaps

Sham Sui Po, Hong Kong

Github Repository

I wrote a small Python script that helps me to generate Elasticsearch docs from web urls. Here I am adding an web frontend to it using Flask.

To use this script you have to adjust it according to your own Elasticsearch mapping and page elements.

Generate a Single Entry

Paste in a URL and generate an JSON object from it that you can use with Kibana to add the page to Elasticsearch:

Python - Deploying a Web Frontends with Flask

Process Sitemaps to retrieve all URLS

Process a pages XML Sitemap and extract all URLs:

Python - Deploying a Web Frontends with Flask

Generate Entries for an List of URLs

Use the generated file from above and generated Elasticsearch entries for every page in your website:

Python - Deploying a Web Frontends with Flask