0

这是 HTML 文件,由于内容大小而被截断,并在末尾包含一个“img”标签。

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
xmlns:epub="http://www.idpf.org/2007/ops">
<head>
    <meta charset="utf-8"></meta>
    <title>The Waste Land</title>
    <link rel="stylesheet" type="text/css" href="wasteland.css" class="day" title="day"/> 
    <link rel="alternate stylesheet" type="text/css" href="wasteland-night.css" class="night" title="night"/>   
</head>
<body>
    <section epub:type="frontmatter" id="frontmatter">
        <section epub:type="titlepage" id="titlepage">
            <h1>The Waste Land</h1>
            <div class="aut">T.S. Eliot</div>
            <div epub:type="epigraph">              
            </div>
            <p epub:type="dedication">For Ezra Pound: <span xml:lang="it">il migliorfabbro</span></p>
        </section>
    </section>
    <section epub:type="bodymatter" id="bodymatter">
        <section id="ch1">
            <h2>I. THE BURIAL OF THE DEAD</h2>
                <div>Looking into the heart of light, the silence.</div>
                <div xml:lang="de" id="ln42">
                    <em>Od' und leer das Meer</em>.<a epub:type="noteref" class="noteref" href="#note-4">*</a>
                </div>
            </div>
            <div class="linegroup">
                <img src="www.href">The lady of situations.
                </img>
                <div>Here is the man with three staves, and here the Wheel,</div>
                <div>And here is the one-eyed merchant, and this card,</div>
                </div>
    </section>
</body>

这是我的代码

HtmlNodeCollection imgNodes= HTMLDoc.DocumentNode.SelectNodes("//img");

或者

 List<HtmlNode> imgNodes = HTMLDoc.DocumentNode.Descendants().Where(n => n.Name =="img").ToList();

两者都无法检索任何标签。我能做些什么?

4

0 回答 0