I'm trying to extract data from a table into Google Sheets, from this webpage: http://www.moneycontrol.com/stocks/fno/marketstats/futures/gainers/homebody.php?opttopic=&optinst=allfut&sel_mth=1&sort_order=0
I've tried using "IMPORTHTML" and "IMPORTXML" both, however, they do not seem to work. Any suggestions would be greatly appreciated!
This is the error message that comes up on running both the queries:
Error Imported content is empty.
FYI this is what I typed into the spreadsheet:
=IMPORTHTML(" http://www.moneycontrol.com/stocks/fno/marketstats/futures/gainers/homebody.php?opttopic=&optinst=allfut&sel_mth=1&sort_order=0 ", "TABLE", 2)
The table is not dynamically created as it is available in the page source. Even changing the index of the IMPORTHTML function does not help. every index returns "Imported content is empty".
importhtml
fails because of a "form" placed inside of the table. Google Apps Script (UrlFetchApp) may be a way to get around the issue.