alvarobartt / investpy

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

get_stocks_overview - symbol is duplicated #410

Open gibsms opened 3 years ago

gibsms commented 3 years ago

Hi. When I run the function below, the "BA" symbol is duplicated about 50 times although each symbol should be unique. It's the same for other countries as well - always the symbol for the first index result.

investpy.stocks.get_stocks_overview(country='united states', as_json=False, n_results=1000)

alikorayerdinc commented 3 years ago

Hi, I'm trying to get any data with investpy but the same error message appears on the screen. Can you Please help me? Thank you... Ali Koray

The Code is your famous example :

import investpy

search_result = investpy.search_quotes(text='apple', products=['stocks'], countries=['united states'], n_results=1) print(search_result)

The error is C:\Users\aliko\Downloads\investpy-master\venv\Scripts\python.exe C:/Users/aliko/Downloads/investpy-master/tests/testy.py Traceback (most recent call last): File "C:\Users\aliko\Downloads\investpy-master\tests\testy.py", line 3, in search_result = investpy.search_quotes(text='apple', products=['stocks'], File "C:\Users\aliko\Downloads\investpy-master\investpy\search.py", line 127, in search_quotes raise ConnectionError(f"ERR#0015: error {req.status_code}, try again later.") ConnectionError: ERR#0015: error 503, try again later.

Process finished with exit code 1

gibsms @.***>, 28 Haz 2021 Pzt, 08:05 tarihinde şunu yazdı:

Hi. When I run the function below, the "BA" symbol is duplicated about 50 times although each symbol should be unique. It's the same for other countries as well - always the symbol for the first index result.

investpy.stocks.get_stocks_overview(country='united states', as_json=False, n_results=1000)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/410, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARH3OIMUIC5S74TTOWEGI2TTU77J7ANCNFSM47NGD7CA .

gibsms commented 3 years ago

Hi Ali

You will find the correct function to use within the investpy Documentation - https://readthedocs.org/projects/investpy/downloads/pdf/latest/

For example, if you wanted to download the historic stock data for Apple (AAPL) as a DataFrame, use the following function:

df = investpy.stocks.get_stock_historical_data(stock = "AAPL", country = "united states", from_date = "1/1/1900", to_date = "28/6/2021", as_json=False, order='ascending', interval='Daily')

Cheers Matt


From: koray @.> Sent: Monday, 28 June 2021 8:35 PM To: alvarobartt/investpy @.> Cc: gibsms @.>; Author @.> Subject: Re: [alvarobartt/investpy] get_stocks_overview - symbol is duplicated (#410)

Hi, I'm trying to get any data with investpy but the same error message appears on the screen. Can you Please help me? Thank you... Ali Koray

The Code is your famous example :

import investpy

search_result = investpy.search_quotes(text='apple', products=['stocks'], countries=['united states'], n_results=1) print(search_result)

The error is C:\Users\aliko\Downloads\investpy-master\venv\Scripts\python.exe C:/Users/aliko/Downloads/investpy-master/tests/testy.py Traceback (most recent call last): File "C:\Users\aliko\Downloads\investpy-master\tests\testy.py", line 3, in search_result = investpy.search_quotes(text='apple', products=['stocks'], File "C:\Users\aliko\Downloads\investpy-master\investpy\search.py", line 127, in search_quotes raise ConnectionError(f"ERR#0015: error {req.status_code}, try again later.") ConnectionError: ERR#0015: error 503, try again later.

Process finished with exit code 1

gibsms @.***>, 28 Haz 2021 Pzt, 08:05 tarihinde şunu yazdı:

Hi. When I run the function below, the "BA" symbol is duplicated about 50 times although each symbol should be unique. It's the same for other countries as well - always the symbol for the first index result.

investpy.stocks.get_stocks_overview(country='united states', as_json=False, n_results=1000)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/410, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARH3OIMUIC5S74TTOWEGI2TTU77J7ANCNFSM47NGD7CA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/alvarobartt/investpy/issues/410#issuecomment-869572752, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUUTH4Y6RYVN72ZN55JNZGLTVBF6JANCNFSM47NGD7CA.

alikorayerdinc commented 3 years ago

Hi, I didn't write any code yet. Below code is your default example.

import investpy df = investpy.get_stock_historical_data(stock='AAPL', country='United States', from_date='01/01/2010', to_date='01/01/2020') print(df.head())

When I run it, I'm getting in get_stock_historical_data raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.") ConnectionError: ERR#0015: error 503, try again later.

, Look what I've found in the below. This is in your test_investpy program

if req.status_code != 200: raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.")

Probably reason of this error: your server sent me a different status code than 200 if you advise some comment I'll be pleased

Regards Ali

gibsms @.***>, 28 Haz 2021 Pzt, 14:24 tarihinde şunu yazdı:

Hi Ali

You will find the correct function to use within the investpy Documentation - https://readthedocs.org/projects/investpy/downloads/pdf/latest/

For example, if you wanted to download the historic stock data for Apple (AAPL) as a DataFrame, use the following function:

df = investpy.stocks.get_stock_historical_data(stock = "AAPL", country = "united states", from_date = "1/1/1900", to_date = "28/6/2021", as_json=False, order='ascending', interval='Daily')

Cheers Matt


From: koray @.> Sent: Monday, 28 June 2021 8:35 PM To: alvarobartt/investpy @.> Cc: gibsms @.>; Author @.> Subject: Re: [alvarobartt/investpy] get_stocks_overview - symbol is duplicated (#410)

Hi, I'm trying to get any data with investpy but the same error message appears on the screen. Can you Please help me? Thank you... Ali Koray

The Code is your famous example :

import investpy

search_result = investpy.search_quotes(text='apple', products=['stocks'], countries=['united states'], n_results=1) print(search_result)

The error is C:\Users\aliko\Downloads\investpy-master\venv\Scripts\python.exe C:/Users/aliko/Downloads/investpy-master/tests/testy.py Traceback (most recent call last): File "C:\Users\aliko\Downloads\investpy-master\tests\testy.py", line 3, in search_result = investpy.search_quotes(text='apple', products=['stocks'], File "C:\Users\aliko\Downloads\investpy-master\investpy\search.py", line 127, in search_quotes raise ConnectionError(f"ERR#0015: error {req.status_code}, try again later.") ConnectionError: ERR#0015: error 503, try again later.

Process finished with exit code 1

gibsms @.***>, 28 Haz 2021 Pzt, 08:05 tarihinde şunu yazdı:

Hi. When I run the function below, the "BA" symbol is duplicated about 50 times although each symbol should be unique. It's the same for other countries as well - always the symbol for the first index result.

investpy.stocks.get_stocks_overview(country='united states', as_json=False, n_results=1000)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/410, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ARH3OIMUIC5S74TTOWEGI2TTU77J7ANCNFSM47NGD7CA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/alvarobartt/investpy/issues/410#issuecomment-869572752>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AUUTH4Y6RYVN72ZN55JNZGLTVBF6JANCNFSM47NGD7CA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/410#issuecomment-869603414, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARH3OIMVFL7SRA42EJZRH43TVBLXNANCNFSM47NGD7CA .

gibsms commented 3 years ago

Hi. I can run your code without any problem. Perhaps try reinstalling the investpy module and also check any firewall/VPN settings you may have.


From: koray @.> Sent: Monday, 28 June 2021 11:44 PM To: alvarobartt/investpy @.> Cc: gibsms @.>; Author @.> Subject: Re: [alvarobartt/investpy] get_stocks_overview - symbol is duplicated (#410)

Hi, I didn't write any code yet. Below code is your default example.

import investpy df = investpy.get_stock_historical_data(stock='AAPL', country='United States', from_date='01/01/2010', to_date='01/01/2020') print(df.head())

When I run it, I'm getting in get_stock_historical_data raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.") ConnectionError: ERR#0015: error 503, try again later.

, Look what I've found in the below. This is in your test_investpy program

if req.status_code != 200: raise ConnectionError("ERR#0015: error " + str(req.status_code) + ", try again later.")

Probably reason of this error: your server sent me a different status code than 200 if you advise some comment I'll be pleased

Regards Ali

gibsms @.***>, 28 Haz 2021 Pzt, 14:24 tarihinde şunu yazdı:

Hi Ali

You will find the correct function to use within the investpy Documentation - https://readthedocs.org/projects/investpy/downloads/pdf/latest/

For example, if you wanted to download the historic stock data for Apple (AAPL) as a DataFrame, use the following function:

df = investpy.stocks.get_stock_historical_data(stock = "AAPL", country = "united states", from_date = "1/1/1900", to_date = "28/6/2021", as_json=False, order='ascending', interval='Daily')

Cheers Matt


From: koray @.> Sent: Monday, 28 June 2021 8:35 PM To: alvarobartt/investpy @.> Cc: gibsms @.>; Author @.> Subject: Re: [alvarobartt/investpy] get_stocks_overview - symbol is duplicated (#410)

Hi, I'm trying to get any data with investpy but the same error message appears on the screen. Can you Please help me? Thank you... Ali Koray

The Code is your famous example :

import investpy

search_result = investpy.search_quotes(text='apple', products=['stocks'], countries=['united states'], n_results=1) print(search_result)

The error is C:\Users\aliko\Downloads\investpy-master\venv\Scripts\python.exe C:/Users/aliko/Downloads/investpy-master/tests/testy.py Traceback (most recent call last): File "C:\Users\aliko\Downloads\investpy-master\tests\testy.py", line 3, in search_result = investpy.search_quotes(text='apple', products=['stocks'], File "C:\Users\aliko\Downloads\investpy-master\investpy\search.py", line 127, in search_quotes raise ConnectionError(f"ERR#0015: error {req.status_code}, try again later.") ConnectionError: ERR#0015: error 503, try again later.

Process finished with exit code 1

gibsms @.***>, 28 Haz 2021 Pzt, 08:05 tarihinde şunu yazdı:

Hi. When I run the function below, the "BA" symbol is duplicated about 50 times although each symbol should be unique. It's the same for other countries as well - always the symbol for the first index result.

investpy.stocks.get_stocks_overview(country='united states', as_json=False, n_results=1000)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/410, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ARH3OIMUIC5S74TTOWEGI2TTU77J7ANCNFSM47NGD7CA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://github.com/alvarobartt/investpy/issues/410#issuecomment-869572752>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AUUTH4Y6RYVN72ZN55JNZGLTVBF6JANCNFSM47NGD7CA

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/alvarobartt/investpy/issues/410#issuecomment-869603414, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARH3OIMVFL7SRA42EJZRH43TVBLXNANCNFSM47NGD7CA .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/alvarobartt/investpy/issues/410#issuecomment-869697605, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUUTH42RNPJOZGHFWYYVGGLTVB4DRANCNFSM47NGD7CA.

hhaoao commented 2 years ago

I found that redirection(status code: 302) also causes this error. I tried to use a global proxy, but the project does not provide the proxy Settings

screenshot 1