我有 html 页面。我想从遍历整个页面的不同索引中获取图像名称。我的 HTML 页面是:
<html manifest="everything-offline.manifest">
<head>
<title>Column Test</title>
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/contents.css" />
</head>
<body>
<h1>Pugpig Gazette</h1>
<section class="topstories">
<ul>
<li><a href="article-a1.html">
<article>
<h2>Lorizzle ipsizzle dolizzle</h2>
<figure><img src="img/a1.jpg" /></figure>
</article>
</a></li>
<li><a href="article-b1.html">
<article>
<h2>Cras accumsizzle</h2>
<figure><img src="img/b1.jpg" /></figure>
</article>
</a></li>
<li><a href="article-c1.html">
<article>
<h2>Sizzle go to hizzle</h2>
<figure><img src="img/c1.jpg" /></figure>
</article>
</a></li>
<li><a href="article-d1.html">
<article>
<h2>Lorizzle ipsizzle dolizzle</h2>
<figure><img src="img/d1.jpg" /></figure>
</article>
</a></li>
<li><a href="article-d2.html">
<article>
<h2>Cras accumsizzle</h2>
<figure><img src="img/d2.jpg" /></figure>
</article>
</a></li>
<li><a href="article-e1.html">
<article>
<h2>Sizzle go to hizzle</h2>
<figure><img src="img/e1.jpg" /></figure>
</article>
</a></li>
</ul>
</section>
<section class="sections">
<ul>
<li class="section-a"><a href="section-index-a.html">News</a></li>
<li class="section-b"><a href="section-index-b.html">Sport</a></li>
<li class="section-c"><a href="section-index-c.html">Business</a></li>
<li class="section-d"><a href="section-index-d.html">Entertainment</a></li>
<li class="section-e"><a href="section-index-e.html">Finance</a></li>
</ul>
</section>
</body>
</html>
在这里,我想获取图像名称为 a1.jpg、d1.jpg、e1.jpg 等...请指导我如何获取。提前感谢您的帮助。