shilewenuw / get_all_tickers

Get all publicly traded tickers with this library
MIT License
275 stars 124 forks source link

Not returning tickers. #2

Closed cameronShadmehry closed 4 years ago

cameronShadmehry commented 4 years ago

Great job with the library. I have been using it for the last two weeks, but for some reason yesterday it stopped working. The example you gave is not working:

from get_all_tickers import get_tickers as gt tickers = gt.get_tickers(NYSE=True, NASDAQ=True, AMEX=True)

Please let me know if this is just an issue on my side, or if other are having this issue as well.

shilewenuw commented 4 years ago

I'm having this issue as well. pandas is no longer reading the NYSE URLs that I pull the tickers from. For now, please download the tickers using https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nyse&render=download, https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download, and https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=amex&render=download and read them in locally using pandas. I'll report back once I figure out a solution.

cameronShadmehry commented 4 years ago

Thank you for the quick response! I will look into doing this, if you find a solution please let me know. Thanks!

Possums commented 4 years ago
import io

headers = {
    'authority': 'old.nasdaq.com',
    'upgrade-insecure-requests': '1',
    'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36',
    'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
    'sec-fetch-site': 'cross-site',
    'sec-fetch-mode': 'navigate',
    'sec-fetch-user': '?1',
    'sec-fetch-dest': 'document',
    'referer': 'https://github.com/shilewenuw/get_all_tickers/issues/2',
    'accept-language': 'en-US,en;q=0.9',
    'cookie': 'AKA_A2=A; NSC_W.TJUFEFGFOEFS.OBTEBR.443=ffffffffc3a0f70e45525d5f4f58455e445a4a42378b',
}

params = (
    ('letter', '0'),
    ('exchange', 'nyse'),
    ('render', 'download'),
)

response = requests.get('https://old.nasdaq.com/screening/companies-by-name.aspx', headers=headers, params=params)
data = io.StringIO(response.text)
df = pd.read_csv(data, sep=",")

This works for getting the data, it looks like Nasdaq doesn't want you to download with a program.

shilewenuw commented 4 years ago

Hi Possums, thanks for this fix! I'll implement it later today and release the updated pip package.

Possums commented 4 years ago

Happy to help! Thanks for making this package, it's been really useful.

shilewenuw commented 4 years ago

Hi Cameron and Possums, version 1.7 for get-all-tickers has been released and tested. The package is now working again.

jmar-ui commented 3 years ago

Hi Is this library still working? It was working 2 days ago. Now it says:


tickers = gt.get_tickers()

File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\get_all_tickers\get_tickers.py", line 73, in get_tickers tickers_list.extend(exchange2list('nyse')) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\get_all_tickers\get_tickers.py", line 138, in exchange2list df = exchange2df(exchange) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\get_all_tickers\get_tickers.py", line 134, in exchange2df df = pd.read_csv(data, sep=",") File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 605, in read_csv return _read(filepath_or_buffer, kwds) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 463, in _read return parser.read(nrows) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 1052, in read index, columns, col_dict = self._engine.read(nrows) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 2056, in read data = self._reader.read(nrows) File "pandas_libs\parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read File "pandas_libs\parsers.pyx", line 771, in pandas._libs.parsers.TextReader._read_low_memory File "pandas_libs\parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows File "pandas_libs\parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows File "pandas_libs\parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 23, saw 46


imendietamx commented 3 years ago

Hi Is this library still working? It was working 2 days ago. Now it says:

tickers = gt.get_tickers()

File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\get_all_tickers\get_tickers.py", line 73, in get_tickers tickers_list.extend(exchange2list('nyse')) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\get_all_tickers\get_tickers.py", line 138, in exchange2list df = exchange2df(exchange) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\get_all_tickers\get_tickers.py", line 134, in exchange2df df = pd.read_csv(data, sep=",") File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 605, in read_csv return _read(filepath_or_buffer, kwds) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 463, in _read return parser.read(nrows) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 1052, in read index, columns, col_dict = self._engine.read(nrows) File "C:\UsersAppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\io\parsers.py", line 2056, in read data = self._reader.read(nrows) File "pandas_libs\parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read File "pandas_libs\parsers.pyx", line 771, in pandas._libs.parsers.TextReader._read_low_memory File "pandas_libs\parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows File "pandas_libs\parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows File "pandas_libs\parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 23, saw 46

I have the same issue since today

shiyu2011 commented 3 years ago

Any solution?

cryoguy commented 3 years ago

same here!

naveengidha commented 3 years ago

Still receiving the same error as well.

kevigan1 commented 3 years ago

also getting the parsing error

guybou commented 3 years ago

same here...

tylerjiang1127 commented 3 years ago

I also get the Parsing Error when trying to run the get_all_tickers function...

stefanbritting commented 3 years ago

Im also getting this error