In PHP, I would like to download the CSV file behind the "Download" link on the page below but it does not have a URL associated with it, see below. Additionally, any code suggestions for uploading that file into MySQL would be helpful, see below.
This is the page I want to download from, the CSV behind the "Download" link: https://www.barchart.com/futures/quotes/Zbz20/price-history/historical
This is the HTML code of the external page, what URL can I use to download?
<div class="download-button-wrapper"> <a class="bc-btn-icon download" data-ref="historical" data-bc-download-button="ZBZ20_Price History"> <i class="bc-glyph-download"></i> <span>download</span></a> </div>
Upload Code
if ($import_b=='y') {
mysqli_query($conn, 'LOAD DATA LOCAL INFILE \'30-yearcsvout.csv\'
INTO TABLE '.$tabletemp.'
FIELDS TERMINATED by \',\'
LINES TERMINATED BY \'\n\'
IGNORE 1 LINES
')or die(mysqli_error());
echo '...finished importing '.$file_b.' data'.' <br><br>';
}else{
echo 'did not import '.$file_b.' <br>';
}