Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.7k views
in Technique[技术] by (71.8m points)

java css 选择器的问题

网站是

https://gongshang.mingluji.com/beijing/name/三眼科技(北京)有限公司

image.png

String PostCode = DoucumentIns.selectFirst("li:first-child span[class='field-label'] span[class='field-item']").text();
String Community = DoucumentIns.selectFirst("li:nth-child(2) span[class='field-label'] span[class='field-item']").text();

我要css 搞到 图片波浪线两个数据(邮政编码和所属社区两个字段),我这个css 匹配怎么是错的?
然后这个“注册资金”这个字段的css 如何获取?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
("li:first-child span[class='field-label'] span[class='field-item']")

这选择器一看就对应的是下面这个结构,和你的结构不一样。

<ul>
    <li>
        <span class="field-label">
            <span class="field-item"></span>
        </span>
    </li>
</ul>

image.png


更新时间:2020年11月20日19:53:26
我就奇怪了,怎么不信邪呢

https://gongshang.mingluji.com/beijing/name/三眼科技(北京)有限公司

image.png

image.png

image.png

image.png

image.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...