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

RuntimeError: Information could not be retrieved since it is not available at Worldometers.info! #3

Open
nzuhrah opened this issue Dec 27, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@nzuhrah
Copy link

nzuhrah commented Dec 27, 2020

Hi, when I try to retrieve daily chart's data from every country with this code, it appear this kind of error. Can you guide me how to fix it?

data = covid_daily.data(country='malaysia', chart='total-currently-infected-linear', as_json=False)

print(data.head())

Output:

RuntimeError Traceback (most recent call last)
in
----> 1 data = covid_daily.data(country='malaysia', chart='total-currently-infected-linear', as_json=False)
2
3 print(data.head())

~\anaconda3\lib\site-packages\covid_daily\covid.py in data(country, chart, as_json)
166
167 if not flag:
--> 168 raise RuntimeError("Information could not be retrieved since it is not available at Worldometers.info!")
169
170 return data

RuntimeError: Information could not be retrieved since it is not available at Worldometers.info!

@alvarobartt
Copy link
Owner

Hi @nzuhrah I've checked the data and it looks available in worldometers.info/coronavirus, I'll test this tomorrow including some flags so as to spot the error and hopefully fix it! 👍🏻

@alvarobartt alvarobartt self-assigned this Dec 27, 2020
@alvarobartt alvarobartt added the bug Something isn't working label Dec 27, 2020
@OmkarShivaprasad
Copy link

Hi did you find a solution to this?

@alvarobartt
Copy link
Owner

Hi @OmkarShivaprasad I did some fixes some time ago, but I'm not sure whether this is currently fixed or not, can you please check? Thank you! 😄

BTW if this error still persists, please let me know (share the error code too) so that I can find a way to solve this!

@proydu
Copy link

proydu commented Apr 10, 2021

Still same error:

RuntimeError: Information could not be retrieved since it is not available at Worldometers.info!

@kmu2000
Copy link

kmu2000 commented Apr 25, 2021

I got the same error too.

@BaoshanPang
Copy link

BaoshanPang commented May 7, 2021

I am geting the same error too for most country except for 'china':

data = covid_daily.data(country='india', chart='total-currently-infected-linear', as_json=False)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\bpang\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\covid_daily\covid.py", line 168, in data
raise RuntimeError("Information could not be retrieved since it is not available at Worldometers.info!")
RuntimeError: Information could not be retrieved since it is not available at Worldometers.info!
data = covid_daily.data(country='spain', chart='total-currently-infected-linear', as_json=False)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\bpang\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\covid_daily\covid.py", line 168, in data
raise RuntimeError("Information could not be retrieved since it is not available at Worldometers.info!")
RuntimeError: Information could not be retrieved since it is not available at Worldometers.info!
>>> data = covid_daily.data(country='china', chart='total-currently-infected-linear', as_json=False)
data = covid_daily.data(country='cuba', chart='total-currently-infected-linear', as_json=False)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\bpang\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\covid_daily\covid.py", line 168, in data
raise RuntimeError("Information could not be retrieved since it is not available at Worldometers.info!")
RuntimeError: Information could not be retrieved since it is not available at Worldometers.info!
data = covid_daily.data(country='us', chart='total-currently-infected-linear', as_json=False)
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\bpang\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\covid_daily\covid.py", line 168, in data
raise RuntimeError("Information could not be retrieved since it is not available at Worldometers.info!")
RuntimeError: Information could not be retrieved since it is not available at Worldometers.info!

@BaoshanPang
Copy link

I think I find the problem:
the chart "total-currently-infected-linear" is not existed any more for many countries except for 'china'.
We need to use a different chart name in order to get the data. To get what charts are avaible, I use the wget command:
_$ wget "https://www.worldometers.info/coronavirus/country/us/"
--2021-05-07 21:08:12-- https://www.worldometers.info/coronavirus/country/us/
Resolving www.worldometers.info (www.worldometers.info)... 172.67.70.249, 104.26.4.2, 104.26.5.2, ...
Connecting to www.worldometers.info (www.worldometers.info)|172.67.70.249|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'index.html'

 0K .......... .......... .......... .......... ..........  879K
50K .......... .......... .......... .......... .......... 1.40M

100K .......... .......... .......... .......... .......... 2.61M
150K .......... .......... .......... .......... .......... 4.21M
200K .......... .......... .......... .......... .......... 4.18M
250K .......... .......... .......... .......... .......... 3.09M
300K .......... .......... .......... .......... .......... 4.24M
350K .......... .......... ........ 2.99M=0.2s

2021-05-07 21:08:13 (2.17 MB/s) - 'index.html' saved [387305]_

Then search "Highcharts.chart" in the download file index.html:

$ grep Highcharts.chart index.html
Highcharts.chart('deaths-cured-outcome-small', {
Highcharts.chart('coronavirus-cases-linear', {
Highcharts.chart('coronavirus-cases-log', {
Highcharts.chart('graph-cases-daily', {
Highcharts.chart('graph-active-cases-total', {
Highcharts.chart('coronavirus-deaths-linear', {
Highcharts.chart('coronavirus-deaths-log', {
Highcharts.chart('graph-deaths-daily', {

@esinkei
Copy link

esinkei commented Jun 16, 2021


RuntimeError Traceback (most recent call last)

in ()
1 for idx, available_chart in enumerate(AVAILABLE_CHARTS):
----> 2 data = covid_daily.data(country='spain', chart=available_chart, as_json=False)
3 data.plot(ax=axs[pairs[idx]], title=available_chart)
4
5 fig.tight_layout()

/usr/local/lib/python3.7/dist-packages/covid_daily/covid.py in data(country, chart, as_json)
166
167 if not flag:
--> 168 raise RuntimeError("Information could not be retrieved since it is not available at Worldometers.info!")
169
170 return data

RuntimeError: Information could not be retrieved since it is not available at Worldometers.info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants