import re import json with open('/home/x79/sisvietnamvn_01/sisvietnamvn_Trang chính thức hiện tại/Đào tạo tại UMC.html', 'r', encoding='utf-8') as f: html = f.read() # 1. Extract content body_match = re.search(r']*>(.*?)', html, re.IGNORECASE | re.DOTALL) if body_match: body_content = body_match.group(1) else: body_content = html # We will replace the whole div that contains the swiper. # Looking at standard Swiper HTML: #
...
# or something similar. # Since we just want to replace the Swiper Sliders, let's find the container block. # Actually, the user has 4 Swiper Sliders. We can just find the `