alvarobartt / investpy

Financial Data Extraction from Investing.com with Python
https://investpy.readthedocs.io/
MIT License
1.67k stars 381 forks source link

ConnectionError: ERR#0015: error 503, try again later. #440

Open GunduzYuruyen opened 3 years ago

GunduzYuruyen commented 3 years ago

Hi,

I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.

Ekran Alıntısı

davetromp commented 3 years ago

I ran above code with investpy 1.0.7 without encountering the error. Please note that investpy "simply" scrapes the data from investing.com. If you do many requests in a short period, then Investing.com might block your IP. Also the 503 error indicates something went wrong on the side of investing.com. It could be they were experiencing some issues and that these are currently resolved. So try again later is a good suggestion.

GunduzYuruyen commented 3 years ago

I ran above code with investpy 1.0.7 without encountering the error. Please note that investpy "simply" scrapes the data from investing.com. If you do many requests in a short period, then Investing.com might block your IP. Also the 503 error indicates something went wrong on the side of investing.com. It could be they were experiencing some issues and that these are currently resolved. So try again later is a good suggestion.

Thanks for your reply Dave. I m not sendıng so many request so ı mean that cant be reason of this problem. Pycharm is updated with ıts last versıon, also investpy is updated too. But still i m taking same error.. As a last option i will delete python also pycharm and setup all them again. Thank you so much for your reply.

eyalk5 commented 3 years ago

Try with a different ip before..

Monarca100 commented 2 years ago

Good morning. I´ve got the same issue. I´ve changed my internet provider and I´ve got CR-NAT IP protocol. Maybe the problem related to this?. Thank you so much.

ilyasozdogan commented 2 years ago

I have also the same problem

raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.") ConnectionError: ERR#0015: error 503, try again later.

ilyasozdogan commented 2 years ago
1

It'is working on chrome but on pycharm i cant get 200

i have python 3.10 and pycharm 2021.3

gokerbakir commented 2 years ago

Hi, I have got the same ERR#15: error 503 problem. Is there any exact solution to this problem? Thanks in advance..

TangentAlpha commented 2 years ago

Can confirm this is a general issue in mainland China.

Sent the following POST request (extracted from stocks.py in the package):

import requests

params = {
    "curr_id": 6408,
    "smlID": "89993585",
    "header": "AAPL Historical Data",
    "st_date": "01/12/2021",
    "end_date": "01/01/2022",
    "interval_sec": "Daily",
    "sort_col": "date",
    "sort_ord": "DESC",
    "action": "historical_data",
}
head = {
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1623.0 Safari/537.36",
    "X-Requested-With": "XMLHttpRequest",
    "Accept": "text/html",
    "Accept-Encoding": "gzip, deflate",
    "Connection": "keep-alive",
}
url = "https://www.investing.com/instruments/HistoricalDataAjax"
req = requests.post(url, headers=head, data=params)
print(req.__dict__)

And here was the response content received (i.e. the access was likely blocked by Investing.com).

Alternatively, the package akshare is usable in mainland China (VPN is not required).

fearles7810 commented 2 years ago

Hi,

I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.

Ekran Alıntısı Hello, import requests headers_param = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36"} df = investpy.get_stock_historical_data(stock='AAPL', country='United States', from_date='01/01/2010', to_date='01/01/2020',headers=headers_param)

Hcevahir34 commented 2 years ago

I ran above code with investpy 1.0.7 without encountering the error. Please note that investpy "simply" scrapes the data from investing.com. If you do many requests in a short period, then Investing.com might block your IP. Also the 503 error indicates something went wrong on the side of investing.com. It could be they were experiencing some issues and that these are currently resolved. So try again later is a good suggestion.

Thanks for your reply Dave. I m not sendıng so many request so ı mean that cant be reason of this problem. Pycharm is updated with ıts last versıon, also investpy is updated too. But still i m taking same error.. As a last option i will delete python also pycharm and setup all them again. Thank you so much for your reply.

Merhaba, bahsettiğniz soruna çözüm bulabildiniz mi? Aynı hatayı ben de alıyorum. Python ve Pycharmı silip yeniden yüklememe rağmen çözüm bulamadım. Bir çözüm bulduysanız ve paylaşırsanız sevinirim. Teşekkürler.

ersaayan commented 2 years ago

Hi,

I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error.

Ekran Alıntısı

dostum çözebildin mi sorunu

Hcevahir34 commented 2 years ago

Hi, I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error. Ekran Alıntısı

You should change your IP, Turkey is blocked by that service. Try VPN or setup your own VPN on a server not located in Turkey

VPN app solved the problem, thank you!

Hcevahir34 commented 2 years ago

Hi, I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error. Ekran Alıntısı

dostum çözebildin mi sorunu

Evet, VPN uygulaması ile sorun çözüldü.

ersaayan commented 2 years ago

Hi, I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error. Ekran Alıntısı

dostum çözebildin mi sorunu

Evet, VPN uygulaması ile sorun çözüldü.

hangi vpn ile çözdün hotspot shield denedim olmadı.

Hcevahir34 commented 2 years ago

Privado VPN adında bir masaüstü uygulamasında aylık 10 GB ücretsiz kullanım hakkı var. Londra üzerinden bağlanarak denersen çalışacaktır.

4 Eki 2022 Sal 18:07 tarihinde Eren Ali Şavk @.***> şunu yazdı:

Hi, I ve tried many different codes to receive historical datas of some of financial instruments but i m taking "ConnectionError: ERR#0015: error 503, try again later." error. Normally i had been using investpy without any error. [image: Ekran Alıntısı] https://user-images.githubusercontent.com/90219621/132259850-28d960e0-8388-4199-b18b-f1165ee70590.JPG

dostum çözebildin mi sorunu

Evet, VPN uygulaması ile sorun çözüldü.

hangi vpn ile çözdün hotspot shield denedim olmadı.

— Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/440#issuecomment-1267153495, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZHLGC4YAEIS2K4YWX3CD3DWBRB4FANCNFSM5DRBYN4Q . You are receiving this because you commented.Message ID: @.***>

alvarobartt commented 2 years ago

Hi everyone, so the VPN may temporarily solve the issue but block you after N requests so you’ll end up having the same issue (503 HTTP), so please use investiny instead as currently investpy is not stable due to the latest changes on Investing.com.

Refer to: