获取HTML页面的所有图片地址:
getimgsrc() {
let htmlstr = document.getElementsByTagName('html')[0].innerHTML;
let reg = /<img.+?src=('|")?([^'"]+)('|")?(?:\s+|>)/g;
let arr = [];
while (tem = reg.exec(htmlstr)) {
arr.push(tem[2]);
}
return arr;
}