1CLICKTV
SIN ANUNCIOS
from flask import Flask, request, render_template_string
from bs4 import BeautifulSoup
import requests
app = Flask(__name__)
@app.route("/")
def index():
# URL de la página con anuncios
target_url = "https://example.com/page_with_ads"
response = requests.get(target_url)
soup = BeautifulSoup(response.content, "html.parser")
# Eliminar scripts y iframes relacionados con anuncios
for ad in soup.find_all(["script", "iframe"]):
if "ad" in str(ad) or "google" in str(ad):
ad.decompose()
return render_template_string(str(soup))
if __name__ == "__main__":
app.run(debug=True)