根据html中的特定标记检索谷歌搜索结果

时间:2014-07-02 03:53:09

标签: search google-search google-search-api

我正在尝试谷歌搜索一组结果,但结果比预期的要大。 我查看了每一页,结果发现有不同的布局集,大多数误报来自那里,与我期待的不相关。

因此我想将结果仅限于使用某些特定<div>标记中的查询进行搜索。例如,

<div class="content_important">
    I love foo and bar
</div>
<div class="i_dont_want_this">
    I hate foo and bar
</div>

我只在foo and bar中查找<div class="content_important">的查询结果,以便<div class="i_dont_want_this">的结果不会出现在搜索结果中。

关键是我知道如何解析html页面,但是我想在解析之前将它们过滤掉,因为可能有太多的结果需要解析。

0 个答案:

没有答案
相关问题