Jan 3, 2020 08:18 AM
(This post was last modified: Jan 3, 2020 08:19 AM by roosiinfidel09.)
I have just started web scraping. The eventual idea is to display such information from many websites on my web page. My question is where/what should I start to read about formatting the return statement output. The current output is all garbled. I have tried reading up on it however, couldn't make much sense of it. Is there some place where I can read it in the context of displaying this in a nice way on the flask web page?
Quote:BSE Live Jan 03, 16:00 1537.25 1.90 (0.12%) Volume AVERAGE VOLUME 5-Day 467,144 10-Day 575,986 30-Day 455,188 354,087 Prev. Close 1535.35 Open Price 1534.40 1523.40 Today’s L/H 1541.30 1081.25 52 Wk L/H 1617.80 1381.85 L/U Price Band 1688.85 Bid Price (Qty.) 0.00 (0) Offer Price (Qty.) 0.00 (0) VWAP 1535.08 Market Depth (03 Jan 2020) BUYSELL QTY PRICE PRICE QTY 500 1535.05 1535.65 33 301 1534.95 1536.60 21 424 1534.85 1536.70 21 510 1534.75 1536.85 23 1044 1534.70 1537.00 632 0 Total Total 0 Market Depth BUY 0 SELL 0 0% 0% NSE Live Jan 03, 15:59 1537.15 1.85 (0.12%) Volume AVERAGE VOLUME 5-Day 8,111,879 10-Day 9,299,481 30-Day 8,175,032 9,593,498 Prev. Close 1535.30 Open Price 1533.00 1523.00 Today’s L/H 1541.65 1081.10 52 Wk L/H 1617.55 1381.80 L/U Price Band 1688.80 Bid Price (Qty.) 0.00 (0) Offer Price (Qty.) 1537.15 (5051) VWAP 1532.73 Represents Equity.Intra - day transactions are permissible and normal trading is done in this category Series: EQ
Code
from flask import Flask
from bs4 import BeautifulSoup
import requests
app = Flask(__name__)
@app.route('/')
# driver = webdriver.Chrome(executable_path="C:/Users/Abhi/Downloads/cd79/chromedriver.exe")
def scrape():
url = "https://www.moneycontrol.com/india/stockpricequote/refineries/relianceindustries/RI"
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
for el in soup.find_all('div', class_='bse_nse_livebox'):
return el.get_text()
if __name__ == '__main__':
app.run()


![[Image: 0DvFxnA.gif]](https://i.imgur.com/0DvFxnA.gif)