Я пытаюсь выполнить код (часть кода телеграм бота):
url = "https://tonscan.org/address/EQD-k-39wXjeHsldKepINtt6jbrCYcxLrNZ4me6twhk-stO4"
r = requests.get(url)
with open(f'{rk}.html', "w", encoding="utf-8") as f:
f.write(r.text)
И получаю ошибку:
Traceback (most recent call last):
File "/home/MrSalaM/tonbot.py", line 501, in <module>
bot.polling()
File "/home/MrSalaM/tonbot.py", line 441, in callback_inline
File "/home/MrSalaM/.local/lib/python3.9/site-packages/telebot/__init__.py", line 621, in polling
self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,
File "/home/MrSalaM/.local/lib/python3.9/site-packages/telebot/__init__.py", line 695, in __threaded_polling
raise e
File "/home/MrSalaM/.local/lib/python3.9/site-packages/telebot/__init__.py", line 651, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/home/MrSalaM/.local/lib/python3.9/site-packages/telebot/util.py", line 147, in raise_exceptions
raise self.exception_info
File "/home/MrSalaM/.local/lib/python3.9/site-packages/telebot/util.py", line 93, in run
task(*args, **kwargs)
File "/home/MrSalaM/tonbot.py", line 441, in callback_inline
r = requests.get(url)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='tonscan.org', port=443): Max retries exceeded with url: /address/EQD-k-39wXjeHsldKepINtt6jbrCYcxLrNZ4me6twh
k-stO4 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 403 Forbidden')))
То же происходит, если я использую API... Бот хостится на бесплатном тарифе
https://www.pythonanywhere.com/ , может в этом дело? Если нет, то как исправить это?