How to put scraped info on your own website?

How do I take the info that I scraped (that shows up in >_Console) and put it onto my website? In this case I would like to have the scraped links shown on my website.
**Repl link: **

import requests
from bs4 import BeautifulSoup
from flask import Flask, render_template

url = ""

response = requests.get(url)
html = response.text

soup = BeautifulSoup(html, "html.parser")
links = soup.findAll("a")
for link in links:
  href = link.get("href")
  if href.startswith("/programma"):

app = Flask(__name__)

def home():
  return render_template("index.html")

if __name__ == '__main__':'')

Hi @Floris2001 thanks for your question.

One way of making the links feed into your website is to use Python file handling to write the BeautifulSoup output directly to ./templates/index.html

Take a look at my slightly adapted fork here

1 Like

Thanks!! You helped me a lot!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.