这是我从请求获得响应的示例
Instant
我将如何提取底部的url,这只是实际请求正文中包含多个url的示例。
答案 0 :(得分:1)
您可以通过正则表达式搜索并找到匹配的格式:
const urlRegex =/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/ig
// responseBodyText from the response you get
const matchedUrls = responseBodyText.match(urlRegex);
const extractedUrls = matchedUrls ? matchedUrls : []
// it should prints the all the urls on the response if there is any or empty array if not