Main

<div id="fare_comparison"></div>

<script>
(function() {
    // Replace the URL below with the actual URL to your run_fare_comparison.php script
    var phpScriptUrl = '/path/to/your/run_fare_comparison.php';

    // AJAX call to the PHP script
    fetch(phpScriptUrl)
        .then(response => response.json())
        .then(data => {
            // Display the Python output in the fare_comparison div
            var fareComparisonDiv = document.getElementById('fare_comparison');
            fareComparisonDiv.innerHTML = "<pre>" + data.output + "</pre>";
        })
        .catch(error => {
            console.error('Error fetching data:', error);
        });
})();
</script>