ошибка H13 на героку на да sh приложении - PullRequest
0 голосов
/ 18 апреля 2020
import requests
from bs4 import BeautifulSoup
import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table

url='https://docs.google.com/spreadsheets/d/e/2PACX-1vSc_2y5N0I67wDU38DjDh35IZSIS30rQf7_NYZhtYYGU1jJYT6_kDx4YpF-qw0LSlGsBYP8pqM_a1Pd/pubhtml#'
response=requests.get(url)
#print(response)

#parsing html to beautiful soup
html_file=response.text
soup = BeautifulSoup(html_file,'html.parser')

table=soup.find_all('table')[2]
table_rows=table.find_all('tr')[4:]
#create empty lists to store data scraped
state=[]
confirmed=[]
recovered=[]
deaths=[]
active=[]
state_code=[]

for tr in table_rows:
    td=tr.find_all('td')
    state.append(td[0].text)
    confirmed.append(int(td[2].text))
    recovered.append(int(td[3].text))
    deaths.append(int(td[4].text))
    active.append(int(td[5].text))
    state_code.append(td[7].text)

#Data discrepency alteration
position=state.index('Andaman and Nicobar Islands')
state[position]='AN Islands'

#converting to a data frame
headers = ['state_name','confirmed','recovered','deaths','active','state']
df_state = pd.DataFrame(list(zip(state,confirmed,recovered,deaths,active,state_code)),columns=headers)

rec_total=df_state['recovered'].sum()
dec_total=df_state['deaths'].sum()
act_total=df_state['active'].sum()
con_total=df_state['confirmed'].sum()
#print(rec_total,dec_total,act_total,con_total)

#maximum recovery ratio and maximum death ratio
max_recovery_ratio=(df_state['recovered']/df_state['confirmed']).max()
max_recovery_state=df_state.loc[df_state['recovered']/df_state['confirmed']==max_recovery_ratio,'state_name']
max_death_ratio=(df_state['deaths']/df_state['confirmed']).max()
max_death_state=df_state.loc[df_state['deaths']/df_state['confirmed']==max_death_ratio,'state_name']
#print(max_recovery_state,max_recovery_ratio)
#print(max_death_state,max_death_ratio)

table2=soup.find_all('table')[6]
table_rows2=table2.find_all('tr')[2:]

date=[]
daily_con=[]
total_con=[]
daily_rec=[]
total_rec=[]
daily_dec=[]
total_dec=[]

for tr in table_rows2:
    td=tr.find_all('td')
    date.append(td[0].text)
    daily_con.append(td[1].text)
    total_con.append(td[2].text)
    daily_rec.append(td[3].text)
    total_rec.append(td[4].text)
    daily_dec.append(td[5].text)
    total_dec.append(td[6].text)

#Data discrepency alteration
del(date[1])
del(daily_con[1])
del(total_con[1])
del(daily_rec[1])
del(total_rec[1])
del(daily_dec[1])
del(total_dec[1])

#time-series dataframe
headers2=['date','dailyConfirmed','totalConfirmed','dailyRecovered','totalRecovered','dailyDeceased','totalDeceased']
df_ts=pd.DataFrame(list(zip(date,daily_con,total_con,daily_rec,total_rec,daily_dec,total_dec)),columns=headers2)

df_temp=df_state[['state','confirmed','active','recovered','deaths']]

app=dash.Dash(__name__)
app.layout=html.Div([
    html.H1('COVID19 TRACKER INDIA',
           style={
               'textAlign':'left',
               'background':'#EAECEE',
               'padding':'25px',
               'color':'#2C3E50'
           }),
    html.Div([
    html.Div([
        html.H1(con_total,
           style={
               'color':'#CB4335',
               'paddingTop':'0px',
               'marginTop':'-10px',
           }),
        html.P('Confirmed',
           style={
               'color':'#CB4335',
               'marginTop':'-20px',
           })

    ],
    style={
        'textAlign':'center',
        'fontfamily':'sans-serif',
        'background':'#F5B7B1',
        'width':'120px',
        'height':'40px',
        'padding':'12px',
        'borderRadius':'4px',
        'display':'inline-block'
    }),
    html.Div([
        html.H1(act_total,
           style={
               'color':'#3498DB',
               'paddingTop':'0px',
               'marginTop':'-10px',
           }),
        html.P('Active',
           style={
               'color':'#3498DB',
               'marginTop':'-20px',
           })

    ],
    style={
        'textAlign':'center',
        'background':'#D6EAF8',
        'width':'120px',
        'height':'40px',
        'padding':'12px',
        'borderRadius':'4px',
        'display':'inline-block',
        'marginLeft':'15px'
    }),
    html.Div([
        html.H1(rec_total,
           style={
               'color':'#1D8348',
               'paddingTop':'0px',
               'marginTop':'-10px',
           }),
        html.P('Recovered',
           style={
               'color':'#1D8348',
               'marginTop':'-20px',
           })

    ],
    style={
        'textAlign':'center',
        'background':'#A9DFBF',
        'width':'120px',
        'height':'40px',
        'padding':'12px',
        'borderRadius':'4px',
        'display':'inline-block',
        'marginLeft':'15px'
    }),
    html.Div([
        html.H1(dec_total,
           style={
               'color':'#2C3E50',
               'paddingTop':'0px',
               'marginTop':'-10px',
           }),
        html.P('Deceased',
           style={
               'color':'#2C3E50',
               'marginTop':'-20px',
           })

    ],
    style={
        'textAlign':'center',
        'background':'#EAECEE',
        'width':'120px',
        'height':'40px',
        'padding':'12px',
        'borderRadius':'4px',
        'display':'inline-block',
        'marginLeft':'15px'
    }),
        html.Div([
        html.H1(max_recovery_state,
           style={
               'color':'#1D8348',
               'paddingTop':'0px',
               'marginTop':'-10px',
           }),
        html.P('the state with most recovery ratio',
           style={
               'color':'#1D8348',
               'marginTop':'-20px',
           })

    ],
    style={
        'textAlign':'center',
        'background':'#A9DFBF',
        'width':'26%',
        'height':'40px',
        'padding':'12px',
        'borderRadius':'4px',
        'display':'inline-block',
        'marginLeft':'15px'
    }),
    html.Div([
        html.H1(max_death_state,
           style={
               'color':'#CB4335',
               'paddingTop':'0px',
               'marginTop':'-10px',
           }),
        html.P('the state with most deceased ratio',
           style={
               'color':'#CB4335',
               'marginTop':'-20px',
           })

    ],
    style={
        'textAlign':'center',
        'background':'#F5B7B1',
        'width':'26%',
        'height':'40px',
        'padding':'12px',
        'borderRadius':'4px',
        'display':'inline-block',
        'marginLeft':'15px'
    })
    ]),
    html.Div([
    dcc.Graph(
        figure={
            'data':[{'x':df_temp.state,'y':df_state.confirmed,'name':'Confirmed','line':{'color':'red'}},
                    {'x':df_temp.state,'y':df_state.recovered,'name':'Recovered','line':{'color':'#2ECC71 '}},
                    {'x':df_temp.state,'y':df_state.deaths,'name':'Deceased','line':{'color':'#85929E'}}
                   ],
            'layout':{
                'title':'STATE - TOTAL CASES',
                'width':'150px',
                'xaxis':{'title':'State/Union Territory','showgrid':False},
                'hovermode':'x unified',
            }
        }
    )],
    style={
    'width':'500px',
    'padding-left':'0px',
    'padding-top':'10px',
    'float':'left'
}),
    html.Div([
    dcc.Graph(
        figure={
            'data':[{'x':df_ts.date,'y':df_ts.totalConfirmed,'name':'Total Confirmed','line':{'color':'red'}},
                    {'x':df_ts.date,'y':df_ts.totalRecovered,'name':'Total Recovered','line':{'color':'#2ECC71'}},
                    {'x':df_ts.date,'y':df_ts.totalDeceased,'name':'Total Deceased','line':{'color':'#85929E'}}],
            'layout':{
                'title':'CUMULATIVE CASES BY DATE',
                'width':'150px',
                'hovermode':'x unified',
                'xaxis':{'showgrid':False}
            }
        }
    )],
    style={
    'width':'500px',
    'padding':'10px',
    'float':'left'
}),
    html.Div([
        dash_table.DataTable(
            id='table',
            columns=[{"name":i,"id":i} for i in df_temp.columns],
            data=df_temp.to_dict("rows"),
            style_table={
                'maxHeight':'490px'
            },
            style_cell={
                'fontFamily':'sans-serif',
                'textAlign':'center',
                'border':'2px solid white',
                'borderCollapse':'collapse'
            },
            style_header={
                'color':'#2C3E50',
                'backgroundColor':'#EAECEE'
            },
            style_cell_conditional=[{
                'if':{'row_index':'odd'},
                'backgroundColor':'#F4F6F6'
            }],
            fixed_rows={
                'headers':True
            }
        )
    ],style={
        "width":"30%",
        "marginTop":"40px",
        "float":"left",
        "marginLeft":"30px",
    })
],
style={
    'font-family':'sans-serif'
})
server=app.server
if __name__=='__main__':
    app.run_server(debug=True)

Суть вышеприведенного кода состоит в том, чтобы просто удалить сайт и с помощью фрейма данных построить информационную панель с da sh plotly framework. Код работает на localhost. Я хочу, чтобы информационная панель обновлялась всякий раз, когда электронная таблица updates.Heby, я включаю ссылку на электронную таблицу ссылка

.gitignore файл

venv
*.pyc
.DS_Store
.env

Procfile

web: gunicorn app:server

needs.txt

alabaster==0.7.12
argh==0.26.2
asn1crypto==1.3.0
astroid==2.3.3
astropy==4.0
atomicwrites==1.3.0
attrs==19.3.0
autopep8==1.4.4
Babel==2.8.0
backcall==0.1.0
backports.functools-lru-cache==1.6.1
backports.shutil-get-terminal-size==1.0.0
backports.tempfile==1.0
backports.weakref==1.0.post1
bcrypt==3.1.7
beautifulsoup4==4.8.2
bitarray==1.2.1
bkcharts==0.2
bleach==3.1.0
bokeh==1.4.0
boto==2.49.0
Bottleneck==1.3.2
certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
Click==7.0
cloudpickle==1.3.0
colorama==0.4.3
comtypes==1.1.7
contextlib2==0.6.0.post1
cryptography==2.8
cycler==0.10.0
Cython==0.29.15
cytoolz==0.10.1
dash==1.11.0
dash-auth==1.3.2
dash-core-components==1.9.1
dash-html-components==1.0.3
dash-renderer==1.4.0
dash-table==4.6.2
dask==2.11.0
decorator==4.4.1
defusedxml==0.6.0
diff-match-patch==20181111
distributed==2.11.0
docutils==0.16
entrypoints==0.3
et-xmlfile==1.0.1
fastcache==1.1.0
filelock==3.0.12
flake8==3.7.9
Flask==1.1.1
Flask-Compress==1.4.0
Flask-SeaSurf==0.2.2
fsspec==0.6.2
future==0.18.2
gevent==1.4.0
glob2==0.7
greenlet==0.4.15
gunicorn==19.7.1
h5py==2.10.0
HeapDict==1.0.1
html5lib==1.0.1
hypothesis==5.5.4
idna==2.8
imageio==2.6.1
imagesize==1.2.0
importlib-metadata==1.5.0
intervaltree==3.0.2
ipykernel==5.1.4
ipython==7.12.0
ipython-genutils==0.2.0
ipywidgets==7.5.1
isort==4.3.21
itsdangerous==1.1.0
jdcal==1.4.1
jedi==0.14.1
Jinja2==2.11.1
joblib==0.14.1
json5==0.9.1
jsonschema==3.2.0
jupyter==1.0.0
jupyter-client==5.3.4
jupyter-console==6.1.0
jupyter-core==4.6.1
jupyterlab==1.2.6
jupyterlab-server==1.0.6
keyring==21.1.0
kiwisolver==1.1.0
lazy-object-proxy==1.4.3
libarchive-c==2.8
llvmlite==0.31.0
locket==0.2.0
lxml==4.5.0
MarkupSafe==1.1.1
matplotlib==3.1.3
mccabe==0.6.1
mistune==0.8.4
mock==4.0.1
more-itertools==8.2.0
mpmath==1.1.0
msgpack==0.6.1
multipledispatch==0.6.0
nbconvert==5.6.1
nbformat==5.0.4
networkx==2.4
nltk==3.4.5
nose==1.3.7
notebook==6.0.3
numba==0.48.0
numexpr==2.7.1
numpy==1.18.1
numpydoc==0.9.2
olefile==0.46
openpyxl==3.0.3
packaging==20.1
pandas==1.0.1
pandocfilters==1.4.2
paramiko==2.7.1
parso==0.5.2
partd==1.1.0
path==13.1.0
pathlib2==2.3.5
pathtools==0.1.2
patsy==0.5.1
pep8==1.7.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.0.0
pkginfo==1.5.0.1
plotly==4.6.0
pluggy==0.13.1
ply==3.11
prometheus-client==0.7.1
prompt-toolkit==3.0.3
psutil==5.6.7
py==1.8.1
pycodestyle==2.5.0
pycosat==0.6.3
pycparser==2.19
pycrypto==2.6.1
pycurl==7.43.0.5
pydocstyle==4.0.1
pyflakes==2.1.1
Pygments==2.5.2
pylint==2.4.4
PyNaCl==1.3.0
pyOpenSSL==19.1.0
pyparsing==2.4.6
pyreadline==2.1
pyrsistent==0.15.7
PySocks==1.7.1
pytest==5.3.5
pytest-arraydiff==0.3
pytest-astropy==0.8.0
pytest-astropy-header==0.1.2
pytest-doctestplus==0.5.0
pytest-openfiles==0.4.0
pytest-remotedata==0.3.2
python-dateutil==2.8.1
python-jsonrpc-server==0.3.4
python-language-server==0.31.7
pytz==2019.3
PyWavelets==1.1.1
pywin32-ctypes==0.2.0
pywinpty==0.5.7
PyYAML==5.3
pyzmq==18.1.1
QDarkStyle==2.8
QtAwesome==0.6.1
qtconsole==4.6.0
QtPy==1.9.0
requests==2.22.0
retrying==1.3.3
rope==0.16.0
ruamel-yaml==0.15.87
scikit-image==0.16.2
scikit-learn==0.22.1
scipy==1.4.1
seaborn==0.10.0
Send2Trash==1.5.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.14.0
snowballstemmer==2.0.0
sortedcollections==1.1.2
sortedcontainers==2.1.0
soupsieve==1.9.5
Sphinx==2.4.0
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
sphinxcontrib-websupport==1.2.0
spyder==4.0.1
spyder-kernels==1.8.1
SQLAlchemy==1.3.13
statsmodels==0.11.0
sympy==1.5.1
tables==3.6.1
tblib==1.6.0
terminado==0.8.3
testpath==0.4.4
toolz==0.10.0
tornado==6.0.3
tqdm==4.42.1
traitlets==4.3.3
ua-parser==0.10.0
ujson==1.35
unicodecsv==0.14.1
urllib3==1.25.8
watchdog==0.10.2
wcwidth==0.1.8
webencodings==0.5.1
Werkzeug==1.0.0
widgetsnbextension==3.5.1
win-inet-pton==1.1.0
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.11.2
xlrd==1.2.0
XlsxWriter==1.2.7
xlwt==1.3.0
xmltodict==0.12.0
yapf==0.28.0
zict==1.0.0
zipp==2.2.0

при развертывании на heroku показывает ошибка приложения

Журналы ошибок приложения приведены ниже.

2020-04-18T06:46:35.042938+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2020-04-18T06:46:35.043081+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2020-04-18T06:46:35.043086+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 203, in run
2020-04-18T06:46:35.043272+00:00 app[web.1]: super(Application, self).run()
2020-04-18T06:46:35.043277+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2020-04-18T06:46:35.043419+00:00 app[web.1]: Arbiter(self).run()
2020-04-18T06:46:35.043423+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 231, in run
2020-04-18T06:46:35.043606+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2020-04-18T06:46:35.043611+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 344, in halt
2020-04-18T06:46:35.043826+00:00 app[web.1]: self.stop()
2020-04-18T06:46:35.043872+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
2020-04-18T06:46:35.044141+00:00 app[web.1]: time.sleep(0.1)
2020-04-18T06:46:35.044146+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 244, in handle_chld
2020-04-18T06:46:35.044326+00:00 app[web.1]: self.reap_workers()
2020-04-18T06:46:35.044364+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 524, in reap_workers
2020-04-18T06:46:35.044625+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2020-04-18T06:46:35.044656+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2020-04-18T06:46:35.136895+00:00 heroku[web.1]: State changed from up to crashed
2020-04-18T06:46:35.141197+00:00 heroku[web.1]: State changed from crashed to starting
2020-04-18T06:47:11.217990+00:00 app[web.1]: [2020-04-18 06:47:11 +0000] [4] [INFO] Starting gunicorn 19.7.1
2020-04-18T06:47:11.218560+00:00 app[web.1]: [2020-04-18 06:47:11 +0000] [4] [INFO] Listening at: http://0.0.0.0:6439 (4)
2020-04-18T06:47:11.218675+00:00 app[web.1]: [2020-04-18 06:47:11 +0000] [4] [INFO] Using worker: sync
2020-04-18T06:47:11.223000+00:00 app[web.1]: [2020-04-18 06:47:11 +0000] [10] [INFO] Booting worker with pid: 10
2020-04-18T06:47:11.258684+00:00 app[web.1]: [2020-04-18 06:47:11 +0000] [11] [INFO] Booting worker with pid: 11
2020-04-18T06:47:12.683728+00:00 heroku[web.1]: State changed from starting to up
2020-04-18T06:47:14.866373+00:00 app[web.1]: [2020-04-18 06:47:14 +0000] [10] [ERROR] Exception in worker process
2020-04-18T06:47:14.866393+00:00 app[web.1]: Traceback (most recent call last):
2020-04-18T06:47:14.866394+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
2020-04-18T06:47:14.866414+00:00 app[web.1]: worker.init_process()
2020-04-18T06:47:14.866415+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 126, in init_process
2020-04-18T06:47:14.866415+00:00 app[web.1]: self.load_wsgi()
2020-04-18T06:47:14.866415+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
2020-04-18T06:47:14.866416+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-04-18T06:47:14.866417+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-04-18T06:47:14.866417+00:00 app[web.1]: self.callable = self.load()
2020-04-18T06:47:14.866417+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2020-04-18T06:47:14.866418+00:00 app[web.1]: return self.load_wsgiapp()
2020-04-18T06:47:14.866418+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2020-04-18T06:47:14.866418+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-04-18T06:47:14.866419+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 352, in import_app
2020-04-18T06:47:14.866419+00:00 app[web.1]: __import__(module)
2020-04-18T06:47:14.866419+00:00 app[web.1]: File "/app/app.py", line 17, in <module>
2020-04-18T06:47:14.866420+00:00 app[web.1]: table=soup.find_all('table')[2]
2020-04-18T06:47:14.866428+00:00 app[web.1]: IndexError: list index out of range
2020-04-18T06:47:14.868025+00:00 app[web.1]: [2020-04-18 06:47:14 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-04-18T06:47:14.895749+00:00 app[web.1]: [2020-04-18 06:47:14 +0000] [11] [ERROR] Exception in worker process
2020-04-18T06:47:14.895751+00:00 app[web.1]: Traceback (most recent call last):
2020-04-18T06:47:14.895752+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
2020-04-18T06:47:14.895752+00:00 app[web.1]: worker.init_process()
2020-04-18T06:47:14.895753+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 126, in init_process
2020-04-18T06:47:14.895753+00:00 app[web.1]: self.load_wsgi()
2020-04-18T06:47:14.895753+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
2020-04-18T06:47:14.895754+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-04-18T06:47:14.895755+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-04-18T06:47:14.895755+00:00 app[web.1]: self.callable = self.load()
2020-04-18T06:47:14.895756+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2020-04-18T06:47:14.895756+00:00 app[web.1]: return self.load_wsgiapp()
2020-04-18T06:47:14.895756+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2020-04-18T06:47:14.895757+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-04-18T06:47:14.895757+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 352, in import_app
2020-04-18T06:47:14.895757+00:00 app[web.1]: __import__(module)
2020-04-18T06:47:14.895758+00:00 app[web.1]: File "/app/app.py", line 17, in <module>
2020-04-18T06:47:14.895758+00:00 app[web.1]: table=soup.find_all('table')[2]
2020-04-18T06:47:14.895816+00:00 app[web.1]: IndexError: list index out of range
2020-04-18T06:47:14.898083+00:00 app[web.1]: [2020-04-18 06:47:14 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-04-18T06:47:15.359619+00:00 heroku[web.1]: State changed from up to crashed
2020-04-18T06:47:15.255279+00:00 app[web.1]: Traceback (most recent call last):
2020-04-18T06:47:15.255291+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 209, in run
2020-04-18T06:47:15.255658+00:00 app[web.1]: self.sleep()
2020-04-18T06:47:15.255681+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 359, in sleep
2020-04-18T06:47:15.256001+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0)
2020-04-18T06:47:15.256051+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 244, in handle_chld
2020-04-18T06:47:15.256408+00:00 app[web.1]: self.reap_workers()
2020-04-18T06:47:15.256413+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 524, in reap_workers
2020-04-18T06:47:15.256837+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2020-04-18T06:47:15.256880+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2020-04-18T06:47:15.256881+00:00 app[web.1]:
2020-04-18T06:47:15.256882+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2020-04-18T06:47:15.256882+00:00 app[web.1]:
2020-04-18T06:47:15.256886+00:00 app[web.1]: Traceback (most recent call last):
2020-04-18T06:47:15.256913+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 8, in <module>
2020-04-18T06:47:15.257380+00:00 app[web.1]: sys.exit(run())
2020-04-18T06:47:15.257381+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2020-04-18T06:47:15.257575+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2020-04-18T06:47:15.257576+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 203, in run
2020-04-18T06:47:15.257833+00:00 app[web.1]: super(Application, self).run()
2020-04-18T06:47:15.257834+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2020-04-18T06:47:15.258041+00:00 app[web.1]: Arbiter(self).run()
2020-04-18T06:47:15.258046+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 231, in run
2020-04-18T06:47:15.258302+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2020-04-18T06:47:15.258303+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 344, in halt
2020-04-18T06:47:15.258636+00:00 app[web.1]: self.stop()
2020-04-18T06:47:15.258637+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
2020-04-18T06:47:15.258989+00:00 app[web.1]: time.sleep(0.1)
2020-04-18T06:47:15.258990+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 244, in handle_chld
2020-04-18T06:47:15.259259+00:00 app[web.1]: self.reap_workers()
2020-04-18T06:47:15.259260+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 524, in reap_workers
2020-04-18T06:47:15.259678+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2020-04-18T06:47:15.259682+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2020-04-18T06:47:15.253084+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/favicon.ico" host=westayhome.herokuapp.com request_id=48e93cd8-d6b4-455c-aae3-c5b757d09f8c fwd="42.109.129.238" dyno=web.1 connect=5000ms service=1184ms status=503 bytes=0 protocol=https

1 Ответ

0 голосов
/ 18 апреля 2020

Проблема в том, что индекс массива выходит за границы.

table=soup.find_all('table')[2] - это проблема

, может быть, вам нужна вторая таблица, в этом случае вам следует использовать: table=soup.find_all('table')[1] запуск beacuse массивов по индексу 0

...