Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get prices, #2

Open
shubham717-developer opened this issue Oct 16, 2020 · 5 comments
Open

Unable to get prices, #2

shubham717-developer opened this issue Oct 16, 2020 · 5 comments

Comments

@shubham717-developer
Copy link

shubham717-developer commented Oct 16, 2020

Whenever I hit
http://127.0.0.1:5000/fuelprice/v1.0/diesel
or any api end point.
IndexError: list index out of range

@phalgun
Copy link
Owner

phalgun commented Oct 16, 2020

@shubham717-developer please share the complete error log.

@shubham717-developer
Copy link
Author

File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 2464, in call
return self.wsgi_app(environ, start_response)
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask_compat.py", line 39, in reraise
raise value
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask_compat.py", line 39, in reraise
raise value
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\dc\Desktop\fuelprice-api-master\app\Lib\site-packages\flask\app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "C:\Users\dc\Desktop\fuelprice-api-master\app.py", line 14, in diesel_prices_all
all_diesel_prices = scrapy.scrape_all_diesel_prices()
File "C:\Users\dc\Desktop\fuelprice-api-master\scrapy.py", line 25, in scrape_all_diesel_prices
diesel_prices[(city).title()] = scrape_latest_price(url_dict[city])
File "C:\Users\dc\Desktop\fuelprice-api-master\scrapy.py", line 13, in scrape_latest_price
stripped_string = str(list(complete_string)[0].strip())
IndexError: list index out of range

@GauravKumar-Tyagi
Copy link

Facing same issue

@shubham717-developer
Copy link
Author

@phalgun maybe the issue is because I am using latest version of python 3.8.1

@ravi-python-mss
Copy link

I think I am having same issue, did you find anything @shubham717-developer ? I am new to python/flask, any help would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants