CyberPunkMetalHead / gateio-crypto-trading-bot-binance-announcements-new-coins

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
MIT License
1.22k stars 302 forks source link

Index out of range exception #9

Closed CHAZTATS closed 3 years ago

CHAZTATS commented 3 years ago

image

grigorerm commented 3 years ago

I made a change in the title parsing logic. Can't create a PR now, might try later

in the file : new_listings_scapper.py add import re at the top change line 25 to:

    announcement  = re.search("Binance Will List", latest_announcement)
    uppers = 0
    if announcement:
        regex = re.search("\(.*\)", latest_announcement)
        uppers = regex.group()[1:len(regex.group())-1]

OR wait for binance to chance their announcement

samugi commented 3 years ago

I fixed this in a similar manner by replacing the whole logic with:

uppers = re.match(r".*\s([A-Z]{2,}).*", latest_announcement).group(1)

It can probably be made more accurate if we trust the format of the announcement

kazyka commented 3 years ago

I fixed this in a similar manner by replacing the whole logic with:

uppers = re.match(r".*\s([A-Z]{2,}).*", latest_announcement).group(1)

It can probably be made more accurate if we trust the format of the announcement

This will give an error if there is nothing in the match

CyberPunkMetalHead commented 3 years ago

This has been fixed