Neurolingua commited on
Commit
cae540a
1 Parent(s): d7b67ed

Update other_function.py

Browse files
Files changed (1) hide show
  1. other_function.py +4 -1
other_function.py CHANGED
@@ -104,8 +104,11 @@ def get_weather(city):
104
  celcius=str(round((int(degree) - 32)* 5/9,1))+temperature[-2]+'C'
105
  return (celcius)
106
 
 
 
 
107
  def get_rates():
108
- r = requests.get('https://www.kisandeals.com/mandiprices/ALL/TAMIL-NADU/ALL')
109
  soup = BeautifulSoup(r.text, 'html.parser')
110
 
111
  # Assuming the table you want is the first one
 
104
  celcius=str(round((int(degree) - 32)* 5/9,1))+temperature[-2]+'C'
105
  return (celcius)
106
 
107
+ headers = {
108
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
109
+ }
110
  def get_rates():
111
+ r = requests.get('https://www.kisandeals.com/mandiprices/ALL/TAMIL-NADU/ALL',headers=headers)
112
  soup = BeautifulSoup(r.text, 'html.parser')
113
 
114
  # Assuming the table you want is the first one