mercredi 19 décembre 2018

Internal errors caused with BeautifulSoup basic function

I want to modify multiples values inside my HTML through my Python app. I found that I should use BeautifulSoup. I installed it and now I'm trying to get my HTML code as a soup.

from flask import *
from bs4 import BeautifulSoup

import random
import socket
import json    
app = Flask(__name__, static_url_path='')

#BEAUTIFUL SOUP TEST------------------------------

with open("static/index.html") as fp:
    soup = BeautifulSoup(fp, "lxml")

#soup = BeautifulSoup("<html>data</html>")
#-------------------------------------------------
def send(data):
   #some code that aren't useful here

@app.route('/')
def index():
    return app.send_static_file('index.html')

I have no informations about my errors, it's just that when I want to access my localhost I have an internal error




Aucun commentaire:

Enregistrer un commentaire