Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting ERR#0004 everytime using the function #328

Closed
kevin-setiawan opened this issue Apr 7, 2021 · 7 comments
Closed

Getting ERR#0004 everytime using the function #328

kevin-setiawan opened this issue Apr 7, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@kevin-setiawan
Copy link

Hello I encounter a problem just today when I am using the command which retrieves data from investing. com
Yesterday it runs alright without any problem. I tried using 2 different command :

  1. stocks_data_df = investpy.get_stock_historical_data(stock='BBVA', country='spain', from_date='01/01/2018', to_date='01/01/2019')
    and I get this result :
    File "C:\Users\G40.80\Anaconda3\lib\site-packages\investpy\stocks.py", line 613, in get_stock_historical_data

RuntimeError: ERR#0004: data retrieval error while scraping.

  1. result = investpy.get_stock_information('bbca','indonesia')
    and I get this result :

File "C:\Users\G40.80\Anaconda3\lib\site-packages\investpy\stocks.py", line 1133, in get_stock_information
elif value.contains('T'):

RuntimeError: ERR#0004: data retrieval error while scraping.

Thankyou.

@TradeForce-AI
Copy link

I think they changed something on the website and the scraper fails everytime.. hopefully the developer will fix the issue soon..

@pourquoi42
Copy link

Same Problem for me. It worked the day before. No code changes, no change of version of investpy. Today it doesnt work any more.

investpy 1.0.4

python3.6/site-packages/investpy/indices.py",` line 606, in get_index_historical_data
raise RuntimeError("ERR#0004: data retrieval error while scraping.")

@danilogalisteu
Copy link
Contributor

danilogalisteu commented Apr 7, 2021

I wrote about a solution to this on #327. You can make the changes manually until the fix is implemented, by removing the br encoding option from the header field Accept-Encoding.

@Dogsbreath1
Copy link

Dogsbreath1 commented Apr 8, 2021

I wrote about a solution to this on #327. You can make the changes manually until the fix is implemented, by removing the br encoding option from the header field Accept-Encoding.

Many thanks! I removed the all br's in search.py, search._obj.py and etfs.py and now up and running!
Before: "Accept-Encoding": "gzip, deflate, br",
After: "Accept-Encoding": "gzip, deflate",

@alvarobartt alvarobartt self-assigned this Apr 8, 2021
@alvarobartt alvarobartt added the bug Something isn't working label Apr 8, 2021
@alvarobartt alvarobartt added this to To do in investpy v1.1.0 via automation Apr 8, 2021
@alvarobartt
Copy link
Owner

Thanks a lot to everyone, especially to @nhlsm and to @danilogalisteu, as the solution they proposed works like a charm. The tests are already running, but once I check everything is OK (besides the Investing.com issues that have nothing to do with investpy), I'll upload the new release mentioning everyone involved in solving it! 🔥 Thanks for this awesome support and sorry for my delayed response.

@alvarobartt
Copy link
Owner

You can install the new-fixed version as it follows:

pip install investpy==1.0.5

Sorry for the inconvenience, seems that Investing.com is applying a lot of changes and under maintenance... Everyone thank both @danilogalisteu and @nhlsm for their awesome support! 👍🏻

investpy v1.1.0 automation moved this from To do to Done Apr 8, 2021
@alvarobartt
Copy link
Owner

Feel free to drop some comments here #334 and more information if applicable, such as the IDs of the solved issues and so on, so that I can include all the information into the Release Notes! 🤗 Thank you!

t-tani added a commit to t-tani/investpy that referenced this issue Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

6 participants