Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction
Sentiment-Analysis-in-Event-Driven-Stock-Price-Movement-Prediction copied to clipboard
all_tickers.py is stuck
I think there is a problem with the urlib.request. Might need to add a header
Hi @dropcunt, I got the same problem. Have you found a way to fix it?
Hi @tmhieu99 and @dropcunt, I stumbled upon the same problem and the solution is actually very easy. The exchange where the script is fetching the data from changed its routing, which is why it gets stuck. In all_tickers.py, you need to replace the part where you fetch the exchange data to this:
for exchange in ["NASDAQ", "NYSE", "AMEX"]:
# this is the changed URL
url = "https://api.nasdaq.com/api/screener/stocks?offset=0&exchange={}&download=true"
repeat_times = 10
for _ in range(repeat_times):
response = urlopen(url.format(exchange))
I was then able to successfully download the tickers
Hi @dkubanyi, tt worked now. Thanks for your solution.
@dkubanyi could you send the full code block? When I do this, it still does not work.