I have a website and I wan't to pull the text form a div tag with bs4 using an external website. and this is a flask website
#Importing librarys
from flask import Flask, render_template
import sys
import json
import requests
import urllib.request
import time
from bs4 import BeautifulSoup
#Importing files and class from other python files in the project
sys.path.append('.')
from webScrape import getInformation
#Making a new app instance
app = Flask(__name__)
#Saying if the app is on route / the open index.html
@app.route('/')
def index():
URL = 'https://covidstat.info/home'
HTML = requests.get(URL)
soup = BeautifulSoup(HTML.text, "html.parser")
tag = soup.findAll('div', {'class': 'count'})
print(tag.text)
return render_template('index.html', tag=tag)
#Running the app on port 5000
if __name__== '__main__':
app.run(debug=True, host='0.0.0.0',)
Oh and I have another question anyone know how I can get an element using xpath in bs4