I'm trying to load the web page http://www.twitch.tv/NAME_OF_CHANNEL/chat?opentga=1
to keep track of a twitch chat through web scraping. The only problem is that whenever someone types a message in chat, a ul
item is added to the html code. My question is, if I load the page with either Selenium or just an HTTP GET request, how can I keep getting the updated code so I can look out for all new chat messages that are sent into the chat?
This is what some of the code looks like.
As you can see there is a ul
element that has a huge list of div
elements with random ids. In each of the div
elements there is the individual chat message, with certain information like what user sent it and at what time. The div
elements are what keep getting updated, one being added every time a message is sent. How can I keep track of all the div
elements saving each one in a list every time a message is sent? Thanks!