22 lines
682 B
Python
22 lines
682 B
Python
from bs4 import BeautifulSoup
|
|
import re
|
|
|
|
with open('/home/x79/sisvietnamvn_01/BV_DHYD_HCM/Đội ngũ bác sĩ UMC.html', 'r', encoding='utf-8') as f:
|
|
soup = BeautifulSoup(f, 'html.parser')
|
|
|
|
styles = soup.find_all('style')
|
|
links = soup.find_all('link', rel='stylesheet')
|
|
|
|
print(f"Found {len(styles)} style tags and {len(links)} stylesheet links.")
|
|
|
|
css_content = ""
|
|
for style in styles:
|
|
css_content += style.get_text() + "\n"
|
|
|
|
print(f"Extracted {len(css_content)} bytes of inline CSS.")
|
|
|
|
with open('src/main/resources/static/css/doctor_styles.css', 'w', encoding='utf-8') as f:
|
|
f.write(css_content)
|
|
|
|
print("Wrote CSS to src/main/resources/static/css/doctor_styles.css")
|