20 lines
488 B
Python
20 lines
488 B
Python
#-*- encoding:utf-8 -*-
|
||
|
||
'''
|
||
@Author : dingjiawen
|
||
@Date : 2023/12/7 20:20
|
||
@Usage :
|
||
@Desc :尝试解析对应的css源文件,来获取对应的我们想要的
|
||
'''
|
||
|
||
import re
|
||
import requests
|
||
url = 'https://antispider4.scrape.center/css/app.654ba59e.css'
|
||
|
||
|
||
response = requests.get(url)
|
||
pattern = re.compile('.icon-(.*?):before\{content:"(.*?)"\}')
|
||
results = re.findall(pattern, response.text)
|
||
icon_map = {item[0]: item[1] for item in results}
|
||
print(icon_map['789'])
|
||
print(icon_map['437']) |