1

I have a simple script that is checking whether there is a pop-out message on the site, if there is it will click it and then play music. I tried with many libraries but only pygames mixer worked for me. After I exported the script to an exe file it clicked the pop out, but the music was not played. I got an error

>>>    mixer.music.load('money.mp3')
>>>pygame.error

Everything was fine in an IDE, today I have opened the script and launched it, the same error occurred. Here is the script code. What does this error means; it is not saying anything about mixer or etc, it is like whole library error.

try:
    but = self.webdriver.find_element_by_xpath('/html/body/div[2]/main/section/fl-search/div/div[2]/div/div[2]/span')
except:
    pass
else:
    while True:
        try:
            but.click()
        except:
            pass
        else:
            mixer.init()
            mixer.music.load('money.mp3')
            mixer.music.play()
            time.sleep(1)
            break
Rabbid76
  • 177,135
  • 25
  • 101
  • 146
Aleksander Ikleiw
  • 2,268
  • 1
  • 5
  • 23

0 Answers0