Input Technical Information

Input Technical Information

The Android input subsystem supports many different device classes, including keyboard, joystick, trackball, mouse, and touch screen. The documentation in this section describes how to configure, calibrate, test, and write drivers for input devices.

你提供的 HTML 中,XPath 表达式: ```xpath br[@class="BR"]/following::text() ``` 表示: > **选择所有 `class="BR"` 的 `<br>` 标签之后的文本节点(按文档顺序)**。 --- ## ✅ **HTML 内容回顾** ```html <div> <br class="BR" style=""> Technical Specifications Belongs To Product FX5-8EYT-ES Display Details NA Input Voltage Range 24 V DC Mounting Support DIN Rail Number of Inputs & Outputs Inputs 8 & Output Operating Temperature 0 °C To +55 °C Model FX5-8EYT-ES Output Relay, Transistor DIMENSION Depth 83mm Weight Width 90 mm <p dir="ltr" class="xpath-helper-highlight" style="outline: red solid 2px;"> We  have a large number of Refurbished Allen Bradley SERVO motor.I hope you need this too. </p> <p dir="ltr">MPL-B330P-SJ72AA<br> MPL-B430P-SJ72AA<br> MPL-B520K-SK74AA<br> MPL-B540K-SJ72AA<br> MPL-B540K-SK72AA<br> MPL-B540K-SK74AA<br> MPL-B640F-SJ72AA<br> MPL-B680H-SJ72AA<br> MPL-B860D-MJ72AA<br> MPM-B1651F-MJ72AA<br> MPL- A220T-HJ72AA<br> VPL- B0633M-PK14AA </p> </div> <div class="pll"> <br> <p class="c26 b"><br>Additional Information:</p> <ul> <li><b>Port of Dispatch: </b>Pondicherry</li> </ul> </div> ``` --- ## ✅ **XPath 表达式解析** ### 1. `br[@class="BR"]` - 只匹配第一个 `<br class="BR">`。 ### 2. `/following::text()` - 选取该节点之后的所有文本节点(在文档顺序中)。 - 包括: - `<br class="BR">` 后面的纯文本(技术参数部分) - `<p>` 标签内的文本 - 后续 `<div class="pll">` 中的所有文本节点(包括“Additional Information:”、“Port of Dispatch: Pondicherry”) --- ## ✅ **匹配结果详解** XPath 表达式会匹配以下文本节点(按顺序): 1. `Technical Specifications Belongs To Product FX5-8EYT-ES Display Details NA Input Voltage Range 24 V DC Mounting Support DIN Rail Number of Inputs & Outputs Inputs 8 & Output Operating Temperature 0 °C To +55 °C Model FX5-8EYT-ES Output Relay, Transistor DIMENSION Depth 83mm Weight Width 90 mm` 2. `We have a large number of Refurbished Allen Bradley SERVO motor.I hope you need this too.` 3. `MPL-B330P-SJ72AA` 4. `MPL-B430P-SJ72AA` 5. `MPL-B520K-SK74AA` 6. `MPL-B540K-SJ72AA` 7. `MPL-B540K-SK72AA` 8. `MPL-B540K-SK74AA` 9. `MPL-B640F-SJ72AA` 10. `MPL-B680H-SJ72AA` 11. `MPL-B860D-MJ72AA` 12. `MPM-B1651F-MJ72AA` 13. `MPL- A220T-HJ72AA` 14. `VPL- B0633M-PK14AA` 15. `Additional Information:` 16. `Port of Dispatch: ` 17. `Pondicherry` --- ## ✅ **Python 示例代码(验证结果)** ```python from lxml import html html_content = ''' <div> <br class="BR" style=""> Technical Specifications Belongs To Product FX5-8EYT-ES Display Details NA Input Voltage Range 24 V DC Mounting Support DIN Rail Number of Inputs & Outputs Inputs 8 & Output Operating Temperature 0 °C To +55 °C Model FX5-8EYT-ES Output Relay, Transistor DIMENSION Depth 83mm Weight Width 90 mm <p dir="ltr" class="xpath-helper-highlight" style="outline: red solid 2px;"> We  have a large number of Refurbished Allen Bradley SERVO motor.I hope you need this too. </p> <p dir="ltr">MPL-B330P-SJ72AA<br> MPL-B430P-SJ72AA<br> MPL-B520K-SK74AA<br> MPL-B540K-SJ72AA<br> MPL-B540K-SK72AA<br> MPL-B540K-SK74AA<br> MPL-B640F-SJ72AA<br> MPL-B680H-SJ72AA<br> MPL-B860D-MJ72AA<br> MPM-B1651F-MJ72AA<br> MPL- A220T-HJ72AA<br> VPL- B0633M-PK14AA </p> </div> <div class="pll"> <br> <p class="c26 b"><br>Additional Information:</p> <ul> <li><b>Port of Dispatch: </b>Pondicherry</li> </ul> </div> ''' tree = html.fromstring(html_content) # 执行 XPath 表达式 results = tree.xpath("br[@class='BR']/following::text()") # 清理并打印结果 for text in results: print(repr(text.strip())) ``` --- ## ✅ **输出结果(简化)** ``` 'Technical Specifications Belongs To Product FX5-8EYT-ES Display Details NA Input Voltage Range 24 V DC Mounting Support DIN Rail Number of Inputs & Outputs Inputs 8 & Output Operating Temperature 0 °C To +55 °C Model FX5-8EYT-ES Output Relay, Transistor DIMENSION Depth 83mm Weight Width 90 mm' 'We have a large number of Refurbished Allen Bradley SERVO motor.I hope you need this too.' 'MPL-B330P-SJ72AA' 'MPL-B430P-SJ72AA' 'MPL-B520K-SK74AA' 'MPL-B540K-SJ72AA' 'MPL-B540K-SK72AA' 'MPL-B540K-SK74AA' 'MPL-B640F-SJ72AA' 'MPL-B680H-SJ72AA' 'MPL-B860D-MJ72AA' 'MPM-B1651F-MJ72AA' 'MPL- A220T-HJ72AA' 'VPL- B0633M-PK14AA' 'Additional Information:' 'Port of Dispatch:' 'Pondicherry' ``` --- ## ✅ **总结** XPath 表达式 `br[@class="BR"]/following::text()` 会匹配: - `<br class="BR">` 之后的所有文本节点(包括跨层级、跨标签) - 不管这些文本节点属于哪个父节点,只要在文档顺序中位于该 `<br>` 之后,都会被匹配 --- ##
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值