Welcome to OStack Knowledge Sharing 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...