有 jQuery 网页抓取工具吗?

发布于 2024-08-26 17:21:03 字数 203 浏览 4 评论 0原文

我正在尝试使用 jQuery 和 Adob​​e AIR 从外部站点提取一些信息。现在我正在使用隐藏的 div 和 jQuery 的加载函数来加载外部站点的片段,一旦加载信息,我就会使用选择器解析一些信息。这很好,但有点脏,我需要执行几次(不想需要很多隐藏的 div)。

只是想知道是否有人知道用 jQuery 编写的优秀网络爬虫或者我缺少的另一种方法

I'm trying to pullout some info from an external site using jQuery and Adobe AIR. Right now I'm using a hidden div and jQuery's load function to load fragments of the external site, once the info is loaded I parse some info with selectors. This is fine but it's kinda dirty and I need to perform this several times (don't want to need many hidden divs).

Just wondering if anybody knows a good webscraper written in jQuery or maybe another method I'm missing

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尽揽少女心 2024-09-02 17:21:03

您可以直接在 ajax 响应主体上使用选择器:

$.get('http://somewhere.com', '',
    function (html) {
        var scrapedElement = $("#myelement", html);
    }
);

You can use selectors directly on the ajax response body:

$.get('http://somewhere.com', '',
    function (html) {
        var scrapedElement = $("#myelement", html);
    }
);
饭团 2024-09-02 17:21:03

您可以简单地调用 $.ajax,然后通过编写 $(responseHTML) 创建一个分离的 DOM 树。

You can simply call $.ajax, then create a detached DOM tree by writing $(responseHTML).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文