简体   繁体   English

如何使用Selenium(Java / Python)在网页上查找某些文本是否突出显示和下划线?

[英]How to find whether some text is highlighted and underlined on a webpage with Selenium(Java/Python)?

How to find whether some text is highlighted and underlined on a webpage with Selenium(Java/Python)?如何使用Selenium(Java / Python)在网页上查找某些文本是否突出显示和下划线?

I came across above question in my recent interview.我在最近的采访中遇到了上述问题。 Could anyone answer if knows?有知道的可以解答一下吗? Thanks in advance.提前致谢。

By Checking the Style Attribute (text-decoration) you can understand if that word is underlined or not.通过检查样式属性(文本装饰),您可以了解该词是否带有下划线。 And for highlight you can check for particular css style or "<mark> *** </mark>" tag.对于突出显示,您可以检查特定的 css 样式或"<mark> *** </mark>"标签。

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

相关问题 如何在 Java 中使用 selenium web 驱动程序查找突出显示的文本? - How to find the highlighted text using selenium web driver in Java? 如何在网页上查找文本并使用Selenium和Java获取其XPath或CSS - How to find text on a webpage and get its XPath or CSS with Selenium and Java 如何使用Selenium检查页面上是否突出显示文本? - How to check if a text is highlighted on the page using Selenium? 如何使用硒检查文本是否在页面上突出显示 - how to check if a text is highlighted on the page using selenium 如何在网页上使用带有 Java 的 Selenium WebDriver 验证工具提示文本 - How to verify tooltip text using Selenium WebDriver with java on a webpage 如何使用 Java 在 Selenium WebDriver 的隐藏字段中输入一些文本 - How to type some text in hidden field in Selenium WebDriver using Java PDF查明文本是否带下划线或表格单元格 - PDF find out if text is underlined or a table cell 如何使用 Selenium Webdriver 在网页中找到“光标”位置? - How to find “Cursor” position in webpage with Selenium Webdriver? Java-在悬停时的JButton中添加和删除带下划线的文本 - Java - Adding and removing underlined text in a JButton on Hover 如何使用 Java 和 Selenium 计算网页上的元素 - How to count Elements on Webpage with Java & Selenium
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM