const links = document.getElementsByTagName('a');
// 遍历所有链接并查找匹配的网址
for (const link of links) {
const href = link.href;
// 使用正则表达式匹配类似的网址
const urlRegex = /https:\/\/www\.bilibili\.com\/video\/[A-Za-z0-9]+\/?/;
if (urlRegex.test(href)) {
console.log("匹配到的网址: " + href);
}
}
控制台浏览器获取网址
最新推荐文章于 2024-11-29 16:25:25 发布
2094

被折叠的 条评论
为什么被折叠?



