Currently, I am manually obtaining raw data for 10-year historical daily prices for over 200 different tickers from . This process involves searching for each ticker, selecting '10 years' from the Timeframe drop-down menu, waiting for the response, and then clicking 'Download this file in Excel Format' at the bottom corner.
Due to the tedious and time-consuming nature of this task, I am exploring ways to automate it.
I have observed that the 'Download this file in Excel Format' button triggers a JavaScript function:
function getQuotes(download) {
if (!download)
showLoadingSpinner();
var data = $("[id$='ddlTimeFrame']").val();
var submitString = data + '|' + download + "|" + quoteBoxSelectedSymbol; if (!download) {
$.ajax({
type: "POST",
url: baseUrl,
data: submitString,
contentType: "application/json",
success: function (response) {
$("[id$='historicalContainer']").html(response);
$(".genTable tbody tr:odd").addClass("genTablealt");
hideLoadingSpinner();
}
});
}
else {
$("[id$='submitString']").val(submitString);
$("#getFile").submit();
}
}
It appears that the download variable serves as a boolean input when the button is clicked. Is there a possible way to intercept and inspect the endpoint generated by this function using a tool like Postman? My knowledge of JavaScript is limited.