如何导出scruyt提取器?
我编写了一个基于“学习”技术的 scrapyt 提取器,即指定页面上的当前文本并让它计算出 XPath 表达式本身。但是,我现在想导出提取器,以便即使页面发生更改也可以使用它。
scrapyt 的文档现在似乎到处都是,但从我能找到的内容来看,我应该能够放置该行 extractor.export(__FILE__)
并且它应该可以工作。它没有 - 我只是收到一个错误,说导出的参数数量错误,它应该有 0。我已经在没有任何参数的情况下尝试过,但它仍然失败。
我会在 scrapyt 论坛上询问,但似乎已经很久没有人去过那里了!
有什么想法在这里做什么吗?
I've written a scrubyt extractor based on the 'learning' technique - that is, specifying the current text on the page and getting it to work out the XPath expressions itself. However, I now want to export the extractor so that it can be used even when the page has changed.
The documentation for scrubyt seems to be all over the place now, but from what I can find I should be able to put the line extractor.export(__FILE__)
and it should work. It doesn't - I just get an error saying that there is the wrong number of arguments for export, it should have 0. I've tried it without any arguments and it still fails.
I would ask on the scrubyt forum, but it seems like no-one's been there for ages!
Any ideas what to do here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚遇到了同样的问题并尝试了“puts google_data.export()”(试图从谷歌获取一些东西)
这给了我以下内容:
这给了我我正在寻找的 xpath
scrapyt 版本是 0.4.06
Just had the same problem and tried "puts google_data.export()" (trying to get some stuff from google)
This gave me the following:
which gave me the xpath I was looking for
scrubyt version is 0.4.06