Hello all, I'm after a bit of help with getting my code to execute consistently. The code itself is fine - it runs successfully from my desktop, and it has worked once or twice on PythonAnywhere both run directly and as a scheduled task (I'm a free user).
The script simply scrapes Google Finance for the current price of a particular fund, then inputs it into my Google Sheets spreadsheet.
Any thoughts on where I'm going wrong?
The error I've been getting today is this one:
Traceback (most recent call last):
File "/home/MichaelF91/PriceTracker/PriceTracker.py", line 14, in <module>
client = gspread.authorize(creds)
File "/home/MichaelF91/.local/lib/python3.6/site-packages/gspread/client.py", line 402, in authorize
client.login()
File "/home/MichaelF91/.local/lib/python3.6/site-packages/gspread/client.py", line 61, in login
self.auth.refresh(http)
File "/usr/local/lib/python3.6/dist-packages/oauth2client/client.py", line 541, in refresh
self._refresh(http)
File "/usr/local/lib/python3.6/dist-packages/oauth2client/client.py", line 744, in _refresh
self._do_refresh_request(http)
File "/usr/local/lib/python3.6/dist-packages/oauth2client/client.py", line 775, in _do_refresh_request
body=body, headers=headers)
File "/usr/local/lib/python3.6/dist-packages/oauth2client/transport.py", line 282, in request
connection_type=connection_type)
File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1322, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1072, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 995, in _conn_request
conn.connect()
File "/usr/lib/python3.6/http/client.py", line 1392, in connect
super().connect()
File "/usr/lib/python3.6/http/client.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.6/socket.py", line 722, in create_connection
raise err
File "/usr/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable