EinsteinCoder commited on
Commit
34119ef
·
verified ·
1 Parent(s): 80620d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -36,7 +36,7 @@ def get_daily_pred(url):
36
  r = requests.get(URL,headers=headers)
37
  soup = BeautifulSoup(r.content, 'html.parser') # If this line causes an error, run 'pip install html5lib' or install html5lib
38
  #print(soup.prettify())
39
- elements = soup.find_all("p")
40
  today=elements[1].text.strip()
41
  return(today)
42
 
@@ -46,7 +46,7 @@ def get_monthly_pred(url):
46
  r = requests.get(URL,headers=headers)
47
  soup = BeautifulSoup(r.content, 'html.parser') # If this line causes an error, run 'pip install html5lib' or install html5lib
48
  #print(soup.prettify())
49
- article_block =soup.find_all('div', class_="horoscope-sign-content-block")
50
  data=[]
51
  for articles in article_block:
52
  br = articles.find_all('br')
@@ -54,7 +54,8 @@ def get_monthly_pred(url):
54
  br_val = val.text.strip()
55
  data.append(br_val)
56
  monthly = ' '.join(map(str, data))
57
- return(monthly)
 
58
 
59
  def get_weekly_pred(url):
60
  URL = url
@@ -62,7 +63,7 @@ def get_weekly_pred(url):
62
  r = requests.get(URL,headers=headers)
63
  soup = BeautifulSoup(r.content, 'html.parser') # If this line causes an error, run 'pip install html5lib' or install html5lib
64
  #print(soup.prettify())
65
- article_block =soup.find_all('div', class_="span-9 span-sm-9 span-xs-12 col m")
66
  data=[]
67
  for articles in article_block:
68
  br = articles.find_all('br')
@@ -70,7 +71,8 @@ def get_weekly_pred(url):
70
  br_val = val.text.strip()
71
  data.append(br_val)
72
  weekly = ' '.join(map(str, data))
73
- return(weekly)
 
74
 
75
  def predict_horoscope(m_sign, f_sign,strtime,m_daily_pred,f_daily_pred,m_monthly_pred,f_monthly_pred,m_weekly_pred,f_weekly_pred):
76
  # Add your horoscope prediction logic here
 
36
  r = requests.get(URL,headers=headers)
37
  soup = BeautifulSoup(r.content, 'html.parser') # If this line causes an error, run 'pip install html5lib' or install html5lib
38
  #print(soup.prettify())
39
+ elements = soup.find_all("div", class_="daily-horo text-center")
40
  today=elements[1].text.strip()
41
  return(today)
42
 
 
46
  r = requests.get(URL,headers=headers)
47
  soup = BeautifulSoup(r.content, 'html.parser') # If this line causes an error, run 'pip install html5lib' or install html5lib
48
  #print(soup.prettify())
49
+ article_block =soup.find_all('div', class_="monthly-content")
50
  data=[]
51
  for articles in article_block:
52
  br = articles.find_all('br')
 
54
  br_val = val.text.strip()
55
  data.append(br_val)
56
  monthly = ' '.join(map(str, data))
57
+ mday=article_block[0].text.strip()
58
+ return(mday)
59
 
60
  def get_weekly_pred(url):
61
  URL = url
 
63
  r = requests.get(URL,headers=headers)
64
  soup = BeautifulSoup(r.content, 'html.parser') # If this line causes an error, run 'pip install html5lib' or install html5lib
65
  #print(soup.prettify())
66
+ article_block =soup.find_all('div', class_="daily-horo text-center")
67
  data=[]
68
  for articles in article_block:
69
  br = articles.find_all('br')
 
71
  br_val = val.text.strip()
72
  data.append(br_val)
73
  weekly = ' '.join(map(str, data))
74
+ wday=article_block[0].text.strip()
75
+ return(wday)
76
 
77
  def predict_horoscope(m_sign, f_sign,strtime,m_daily_pred,f_daily_pred,m_monthly_pred,f_monthly_pred,m_weekly_pred,f_weekly_pred):
78
  # Add your horoscope prediction logic here