我是靠谱客的博主 甜美电话,这篇文章主要介绍java解析html标签样式,现在分享给大家,希望可以做个参考。

String style = "position: absolute; width: 500px; height: 552px;";
        String extract = "width";
        if (style.contains(extract)) {
            style = style.substring(style.indexOf(extract));
            System.out.println(style);
            style = style.substring(0, style.indexOf(";"));
            System.out.println(style);
            String attr = style.substring(style.indexOf(":") + 2);
            System.out.println(attr.substring(0, attr.indexOf("px")));
        }

只适用于找到某个标签之后操作样式

侵删

https://www.cnblogs.com/qlqwjy/p/7531579.html

最后

以上就是甜美电话最近收集整理的关于java解析html标签样式的全部内容,更多相关java解析html标签样式内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(71)

评论列表共有 0 条评论

立即
投稿
返回
顶部