html - Get Text in Span Using CSS Selector
问题描述
I'm using a product called Stonly to place tool tips. In there, we are to use the CSS Selector to find the HTML element to identify the tool tip. Now, when I do this for some of our elements on the page, the path isn't what I always want. Instead, I want to identify the element to place a tool tip based on the text in the span. How would I do that?
Below is the CSS Selector output
#root > div:nth-child(3) > div > div.container > div > div.w70.w-990-100 > div:nth-child(3) > div > form > h4 > span
Below is the snippent of HTML
<div className="comm-section">
<form autoComplete="off">
<h4 className="commHdn"><span> Type of Property {data?.type_of_property_id} </span></h4>
{/* 17Dec */}
<div className="f-row f-3 f-576-2">
{/* start */}
解决方案
推荐阅读
- python - 系统地将 conda 列表的输出存储到 python 字典中
- windows - OneDrive 和 Git - 不同的文件夹结构
- python - 如果 API 没有返回任何内容,你如何阻止脚本运行?
- artifactory - 检查文件是否存在于工件中而不下载
- css - 为什么 magin:auto 不足以将绝对或固定位置居中?
- zos - IBM z/OS Metal C - 我可以创建一个包含 #pragma 语句的 #define 宏吗?
- laravel - Laravel 6根据用户的角色重定向用户不起作用
- excel - 使用VBA跳过excel中的单元格
- javascript - 首次使用后过滤数据的功能不起作用
- bash - 使用 bash 查找前 10 个站点的前 10 个请求者