-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcurrentData.py
More file actions
48 lines (31 loc) · 1.2 KB
/
currentData.py
File metadata and controls
48 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
cuurentData.py - Gets realtime data of stock
@authors: Pratiksha Jain, Shubham Saurav
"""
# --------------------------------- #
# Imports needed
import requests
from bs4 import BeautifulSoup
# --------------------------------- #
# Write MoneyControl Stock URL here:
#URL = 'https://www.moneycontrol.com/india/stockpricequote/refineries/relianceindustries/RI'
#URL = 'https://www.moneycontrol.com/india/stockpricequote/telecommunications-service/vodafoneidealimited/IC8'
def getURL(stock):
BASEURL = "https://in.investing.com/equities/"
#pageResponse = requests.get(BASEURL)
# Returns site in form of HTML tags
#bsParser = BeautifulSoup(pageResponse.content, 'html.parser')
# Finding title of stock
#name = bsParser.find_all('a')
return BASEURL
def getCurrentPrice(stock):
URL = getURL(stock)
# Request data from URL, by 'GET' method
#pageResponse = requests.get(URL)
# Returns site in form of HTML tags
#bsParser = BeautifulSoup(pageResponse.content, 'html.parser')
# Finding title of stock
#price = bsParser.find('bdo', class_='last-price-value js-streamable-element').text
#print(price)
return 10
# --------------------------------- #