Does Google Apps Script have something like getElementById?

前端 未结 3 619
温柔的废话
温柔的废话 2020-12-06 08:04

I am gonna to use Google App Script to fetch the programme list from the website of radio station. How can I select the specified elements in the webpage by specifying the i

3条回答
  •  生来不讨喜
    2020-12-06 08:29

    I'm going to assume that you are referring to using UrlFetchApp's fetch() method. In which case, the answer is no, in the context of what you are thinking of.

    If you look at the return type for fetch() in the documentation it returns HTTPResponse. There are a few methods for that, but most of them involve getting the returned data as a string. The good news is, you could still use any (well, most) of the traditional JS String methods documented here - so you could use search(), match(), etc. Depending on your project you could use those to find the data you are looking for in the response.

提交回复
热议问题