Open DSforSC opened 2 years ago
Thanks for posting the traceback. I will look into the cause :)
The URL still works in the browser, but the connection is refused when using the script. It looks like investing.com got wise about web scraping. I think the request header needs to be modified to appear to be coming from a web browser rather than a script. This repo was created as a proof of concept a few years back. Unfortunately, I am committing my time to an different project ATM. If you would like to contribute and post a merge request I will be happy to review it and merge it. Thanks so much for the feed back!
Traceback (most recent call last): File "c:\Users\itcwork\Documents\Python Scripts\Python_projects\Crypto_vs_Metals\importing_metal_btc_prices.py", line 60, in
fetch_prices('https://www.investing.com/commodities/gold-historical-data', 'gold_prices.csv')
File "c:\Users\itcwork\Documents\Python Scripts\Python_projects\Crypto_vs_Metals\importing_metal_btc_prices.py", line 36, in fetch_prices
rows = table.find_all('tr')[1:-1]
AttributeError: 'NoneType' object has no attribute 'find_all'