In a case where the API is capable of delivering the data that you are requesting (e.g. a stat query, dispatch text lookup) you must use the available API endpoint and you may not target the HTML site with a script.
If you have comments, please leave them below. There is no current timeframe for us to make this change, but any change will have a notification period and grace period attached.