简体   繁体   English

如何用 xidel 连接两个提取的值?

[英]How to join two extracted values with xidel?

I use the following to extract two values using xidel -e .我使用以下内容使用xidel -e提取两个值。

  • '//input[@name="qid"]/@value[1]'
  • "//span[@id='trueFinalResultCount']"

But I'd like to put the two results into a TSV format.但我想把这两个结果变成 TSV 格式。

result1<TAB>result2

Could anybody show me how to combine the above two expressions?谁能告诉我如何结合以上两个表达式? (I tried the following. But it doesn't work.) (我尝试了以下方法。但它不起作用。)

'join((//input[@name="qid"]/@value[1], //span[@id='trueFinalResultCount'][1]), x:cps(9))'

string-join( ($x, $y), ' ') and replace ' ' with "tab-key pressed here" string-join( ($x, $y), ' ') 并将 ' ' 替换为 "tab-key press here"

example: xidel URL --xpath 'string-join((somepath1, somepath2)," ")'例如:xidel URL --xpath 'string-join((somepath1, somepath2)," ")'

it results into TSV它导致TSV

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM