我使用WP Web Scraper从以下链接获取标题:http://lpse.acehtenggarakab.go.id/eproc/lelang/view/1316330
标题是:PENGAWASAN/SUPERVISI KEGIATAN FISIK TAHUN 2016
标题位于具有属性class="horizLine"
的<td>
html标记内(它位于包含68行的该html <table>
的第二行(<tr>
html标记))。
我的WP Web Scraper短代码是:
[wpws url="http://lpse.dephub.go.id/eproc/lelang/view/33737114" selector=".horizLine"]
但它不起作用。
我的问题:
如何在短代码的selector
属性中定位此标题,而忽略其他标题?
我认为您需要在shortcode selector
属性中添加更多元素,因为显示的html源是:
<tr>
<td width="150" class="TitleLeft">Kode Lelang</td>
<td colspan="3" class="horizLine"><b>1316330</b></td>
</tr>
<tr>
<td class="TitleLeft">Nama Lelang </td>
<td colspan="3" class="horizLine">
<b>
<strong>PENGAWASAN/SUPERVISI KEGIATAN FISIK TAHUN 2016</strong>
</b>
</td>
</tr>
<tr> …
以下是针对标题为selector="tr:nth-child(2) td.horizLine b strong"
:的解决方案
[wpws url="http://lpse.dephub.go.id/eproc/lelang/view/33737114" selector="tr:nth-child(2) td.horizLine b strong"]
对于:nth-child(2)
,我的目标是第二个<tr>
html元素。