I am doing a simple web crawler, using django 2.0, I want to capture only the "title" class of the news and then render "return render" to a simple html, below my view.py. At the moment I'm using the "Return HttpRensonse". how can I get the data and render to an html?
from django.shortcuts import render
import requests
from bs4 import BeautifulSoup
from lxml import html
import urllib3
from django.http import HttpResponse #Para apenas fazer testes testes apenas
def crawler(request):
url = "https://noticias.uol.com.br/"
response = requests.get(url)
html = response.content
soup = BeautifulSoup(html, "html.parser")
return HttpResponse(soup)