【发布时间】:2018-12-19 14:54:27
【问题描述】:
我想通过我的 Python 应用修改我的 HTML 中的多个值。我发现我应该使用 BeautifulSoup。我安装了它,现在我正试图将我的 HTML 代码作为汤。
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')
我没有关于我的错误的信息,只是当我想访问我的本地主机时出现内部错误
【问题讨论】:
标签: python html web beautifulsoup