import urllib.request
import gzip
from bs4 import BeautifulSoup

req = urllib.request.Request('https://sarabeauty.ae/service/full-body-scrub/', headers={'User-Agent': 'Mozilla/5.0'})
resp = urllib.request.urlopen(req)
data = resp.read()
if resp.info().get('Content-Encoding') == 'gzip':
    data = gzip.decompress(data)
html = data.decode('utf-8')
soup = BeautifulSoup(html, 'html.parser')

print("MAIN:", soup.find('main') is not None)
print("CONTENT DIV:", soup.find('div', id='content') is not None)
print("WP-POST elements:", len(soup.find_all('div', {'data-elementor-type': 'wp-post'})))

for i, div in enumerate(soup.find_all(lambda tag: tag.name == 'div' and tag.get('data-elementor-type') in ['wp-post', 'wp-page', 'single-post'])):
    print(f"Index {i}: type={div.get('data-elementor-type')}, post-type={div.get('data-elementor-post-type')}, length={len(str(div))}, has_parent={div.parent.get('data-elementor-type') if div.parent else None}")
