1
I am making 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. I am currently using "Return Httprensonse". how can I take 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)