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
362 views
in Technique[技术] by (71.8m points)

html - How to parse CSS of custom CSS font in python?

How can I parse following css. I want to get "/public/nfonts/roboto-v152.svg?xvyl5q#icomoon" this url from following css and also should be able to determine which content curresponds to which class for example icon-ts="9d004" something like this.

CSS:

@font-face {
    font-family: 'icomoon';
    src: url(/public/nfonts/roboto-v152.eot?xvyl5q);
    src: url(/public/nfonts/roboto-v152.eot?xvyl5q#iefix) format("embedded-opentype"), url(/public/nfonts/roboto-v152.woff2?xvyl5q) format("woff2"), url(/public/nfonts/roboto-v152.ttf?xvyl5q) format("truetype"), url(/public/nfonts/roboto-v152.woff?xvyl5q) format("woff"), url(/public/nfonts/roboto-v152.svg?xvyl5q#icomoon) format("svg");
    font-weight: 400;
    font-style: normal
}

[class^="icon-"],
[class*=" icon-"] {
    font-family: 'icomoon'!important;
    speak: none;
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

.icon-fde:before {
    content: "9d005"
}

.icon-wyx:before {
    content: "9d009"
}

.icon-ts:before {
    content: "9d004"
}

.icon-trs:before {
    content: "9d007"
}

.icon-ba:before {
    content: "9d001"
}

.icon-fe:before {
    content: "9d008"
}

.icon-oqp:before {
    content: "9d010"
}

.icon-vu:before {
    content: "9d006"
}

.icon-rq:before {
    content: "9d003"
}

.icon-hg:before {
    content: "9d002"
}

.icon-po:before {
    content: "9d011"
}

.icon-ji:before {
    content: "9d012"
}

.icon-ikj:before {
    content: "9d013"
}

.icon-wx:before {
    content: "9d014"
}

.mobilesv {
    font-size: 11px;
    color: #000;
    padding: 0 1px;
    letter-spacing: .6px;
    font-weight: 700
}

.comptel .mobilesv {
    font-weight: 400;
    font-size: 10px
}

.comptel {
    white-space: nowrap
}

.comp-contact .icon-valplus {
    font-size: 8px
}

.icon-ji {
    font-size: 1px;
    position: relative;
    top: -4px
}

.rstocnct .mobilesv {
    font-size: 12px;
    color: #fff;
    padding: 0 1px;
    letter-spacing: .9px
}

.rstocnct .icon-ji {
    font-size: 1px;
    position: relative;
    top: -4px
}

.rstocnct .icon-po {
    font-size: 10px
}

.store-details .mobilesv {
    font-size: 11px;
    color: #424242;
    font-weight: 400
}

.store-details p.contact-info span.mobilesv {
    margin: 0
}

.store-details .icon-ji {
    font-size: 1px
}

.store-details .icon-po {
    font-size: 8px
}

.jdtlphntxt .mobilesv {
    font-size: 10px;
    color: #424242;
    font-weight: 400
}

.jdtlphntxt .icon-ji {
    font-size: 1px
}

.jdtlphntxt .icon-po {
    font-size: 8px
}

.jdtlphntxt .mobilesv {
    letter-spacing: .5px
}

.compdt .mobilesv {
    font-size: 10px;
    color: #424242;
    font-weight: 400
}

.compdt .icon-ji {
    font-size: 1px
}

.compdt .icon-po {
    font-size: 8px
}

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

1 Reply

0 votes
by (71.8m points)
等待大神答复

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

...