Skip to content
Advertisement

Can’t extract table from yahoo finance

I try to run the below code but still can’t get the proper output in Excel with headers. Please help.

JavaScript
JavaScript

The intended format will be in the below pic. pic

Advertisement

Answer

If an Excel spreadsheet isn’t mandatory, then your “result” variable can be saved as a txt file in the same formatting in terms of rows and columns by including the following lines of code afterwards:

JavaScript

To read that saved txt file at a later point in time:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement