【问题标题】:Middle Selectors Ignored in hxselecthxselect 中忽略的中间选择器
【发布时间】:2018-01-29 02:38:08
【问题描述】:

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

/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

代码在任何一个或两个选择器上都能正常执行。当我使用两个以上时,只有第一个和最后一个有任何效果。无论使用的选择器或选择器的数量如何,中间的似乎都被忽略了。

是我的错误还是 hxselect

【问题讨论】:

    标签: css html-xml-utils


    【解决方案1】:

    选项:hxselect -c ....

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-27
      • 2012-02-26
      • 2012-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多