Search code examples
pythonhtmlbeautifulsoupmp3

Is it possible to write a Python web scraper that plays an mp3 whenever an element's text changes?


Trying to figure out how to make python play mp3s whenever a tag's text changes on an Online Fantasy Draft Board (ClickyDraft).

I know how to scrape elements from a website with python & beautiful soup, and how to play mp3s. But how do you think can I have it detect when a certain element changes so it can play the appropriate mp3?

I was thinking of having the program scrape the site every 0.5seconds to detect the changes,

but I read that that could cause problems? Is there any way of doing this?


Solution

  • The only way is too scrape the site on a regular basis. 0.5s is too fast. I don't know how time sensitive this project is. But scraping every 1/5/10 minute is good enough. If you need it quicker, just get a proxy (plenty of free ones out there) and you can scrape the site more often.

    Just try respecting the site, Don't consume too much of the sites ressources by requesting every 0.5 seconds