Provided is a Python file for converting a fetched XML file of stocks/industries into a .csv file and mapping each stock to it's country/exchange.
The script requires a full_stocklist_xml.xml file to be provided which can be fetched via This Yahoo Finance Query
I have also manually created a JSON mapping file that maps the various exchanges and their host countries to their Yahoo Finance extension as Detailed Here
The output is a .csv file called yahoo_stocklist.csv which has the first row containing the headings: YAHOO TICKER, COMPANY NAME, INDUSTRY, COUNTRY TRADED, EXCHANGE