hxselect中忽略的中间选择器 [英] Middle Selectors Ignored in hxselect

查看:55
本文介绍了hxselect中忽略的中间选择器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 html-xml-utils 7.4 中的 hxselect 从网页中提取一些文本.据该名男子称,hxselect将接受以逗号分隔的CSS选择器列表.我有三个选择器:

I'm attempting to extract some text from a webpage using hxselect from html-xml-utils 7.4. According to the man, hxselect will accept a comma delimited list of CSS selectors. I have three selectors:

/usr/local/bin/hxnormalize -x -i 0 -l 5000 https://domain.tld | /usr/local/bin/hxselect -s'\n' 'div#searchfieldouter, div#searchbutton, input.searchfield' > ~/result.html

该代码可以使用任意一个或两个选择器正常运行.当我使用两个以上时,只有第一个和最后一个有效.无论选择器或使用的选择器数量如何,似乎都忽略了中间的选择器.

The code performs properly with any one or two of the selectors. When I use more than two, only the first and last have any effect. Regardless of the selectors or number of selectors used, the middle ones seem to be ignored.

是我的错误还是 hxselect ?

推荐答案

选项:hxselect -c ....

Option: hxselect -c ....

hxnormalize -x -i 0 -l 5000 https://domain.tld |
   hxselect -s'\n' -c 'div#searchfieldouter, div#searchbutton, input.searchfield' > ~/result.html

这篇关于hxselect中忽略的中间选择器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆