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() # Try to extract the main content. It's usually inside
or
# Looking at typical Tailwind pages, let's extract everything inside body_match = re.search(r']*>(.*)', html, re.IGNORECASE | re.DOTALL) if body_match: content = body_match.group(1) else: content = html # We know there are 4 Swiper instances. Let's find them. # A swiper usually has `
...
` # It's a bit tricky to parse nested divs with regex. # Let's extract the slider images using regex on `swiper-slide` slides = re.findall(r'
]*>.*?
', html, re.IGNORECASE | re.DOTALL) print(f"Found {len(slides)} slides with images.")