rachitiitr / coronavirus-bot-tracker

Scans the official Government website and throws notifications to Slack when new cases arise (Ministry of Health and Family Welfare)
48 stars 44 forks source link

Add requirements.txt #1

Open Abdulkadir98 opened 4 years ago

Abdulkadir98 commented 4 years ago

First of all loved the video explanation of the project. Thanks for sharing it! I know the number of dependencies is very less but it is good practice to add a requirement file so that people can just run pip install -r requirements.txt

somnath9835 commented 4 years ago

Hello Rachit, First of all many thanks for this app. It really fun learning python in this way offcourse. I am getting an error : Traceback (most recent call last): File "ItsMe:\coronovirus-bot-tracker\corona_bot.py", line 55, in elif any([s.lower() in stat[1].lower() for s in interested_states]): with Exception occured: [list index out of range] exception. Can you please fix this as I am beginner in python and not able to fix it.

imaskm commented 4 years ago

@somnath9835 , Replace BeautifulSoup code with following lines:

souped_data = BeautifulSoup(response,'html.parser')

getting the headers of table

souped_data = BeautifulSoup(str(souped_data.find_all('div',{'class': "content newtab"})),'html.parser') headers = ExtractData(souped_data.tr.find_all('th'))

You can debug your code using pdb module of python, I think Rachit's bs4 code is not working now.

imaskm commented 4 years ago

@rachitiitr , Using your code, I have created a desktop notifier for same case as I couldn't integrate with Slack. Corona Notifier

jayzilpilwar commented 4 years ago

@imaskm Hello' but when i used your code souped_data = BeautifulSoup(response,'html.parser')

getting the headers of table

souped_data = BeautifulSoup(str(souped_data.find_all('div',{'class': "content newtab"})),'html.parser') headers = ExtractData(souped_data.tr.find_all('th'))

I get following error- stat = {'',stat} TypeError: unhashable type: 'list'

I try my best to find out the error,but its fails to cast list to tuple form.If you have any other idea please commit it asap