0
我正在抓取this页面。我访问下面的HTML获取部分细节:Symfony DomCrawler:无法通过Id获取标签
<h2>
<span class="mw-headline" id="Volume_one:_Quicksilver_.282003.29">Volume one:
<i>
<a href="https://en.wikipedia.org/wiki/Quicksilver_(novel)"
class="extiw"
title="w:Quicksilver (novel)">Quicksilver</a>
</i> (2003)
</span>
<span class="mw-editsection">
<span class="mw-editsection-bracket">[</span>
<a href="/w/index.php?title=The_Baroque_Cycle&action=edit&section=1"
title="Edit section: Volume one: Quicksilver (2003)">edit</a>
<span class="mw-editsection-bracket">]</span>
</span>
</h2>
我wanto抢id
,Volume_one:水银 .282003.29。为此,我写了下面的代码:
$sectionid = '#Volume_one:_Quicksilver_.282003.29';
print($crawler->filter($sectionid));
但它没有返回细节,尽管它在那里。我在哪里做错了?它确实取得#Epilogs
部分。
请帮忙。
我做到了。它没有工作,返回null。 – Volatil3
您可以编辑您的文章并在创建客户端的位置显示您的代码,并执行GET并创建爬网程序。你可能错过了一些东西...... –