I would like to read some data from other websites for a project using Google Script. The pages in questions are Dyanmic; they contain content that is loaded after the initial page load, via JavaScript calls to the server. Usually, with somewhat static content, this works fine but I am new to JavaScript and to Google Apps Script and thus do not know how to get the content if it is loaded asynchronously via JavaScript (e.g. via AJAX).
An example can be found here showing the last tracks played at a radio station. However, these tracks are loaded using JavaScript and instead of the table containing the Strings I get
<td class="row2"><span id="track_2"> </span></td>
When I use:
UrlFetchApp.fetch(url).getContentText();
If I save the HTML in my browser, though, the right data Strings are there:
<td class="row2" id="track_2">15:12 Will Smith - Men In Black</td>
^^^^^^^ ^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^^
Is there any way to do this with Google Apps Script?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…