I want scrap chat messages in youtube live chat. At first, I just followed a way in "https://www.youtube.com/watch?v=W2DS6wT6_48"
But the code does not work.
The error message is
all_comments = driver.find_element_by_id("all-comments")
...
selenium.common.exceptions.NoSuchElementException: Message: {"errorMessage":"Unable to find element with id 'all-comments'","request":{"headers":{"Accept":"application/json","Accept-Encoding":"identity","Connection":"close","Content-Length":"93","Content-Type":"application/json;charset=UTF-8","Host":"127.0.0.1:12695", "User-Agent":"Python-urllib/2.7"},"httpVersion":"1.1","method":"POST","post":"{\"using\": \"id\", \"sessionId\": \"e4b63b00-fe9c-11e6-a630-0fa086b5cd8d\", \"value\": \"all-comments\"}","url":"/element","urlParsed":{"anchor":"","query":"","file":"element","directory":"/","path":"/element","relative":"/element","port":"", "host":"","password":"","user":"","userInfo":"","authority":"","protocol":"","source":"/element","queryKey":{},"chunks":["element"]},"urlOriginal":"/session/e4b63b00-fe9c-11e6-a630-0fa086b5cd8d/element"}}
What I understand is that there is no element which name is "all-comments"
So, find_element_by_id
has failed.
And then, I tried some id or xpath to catch chat message
But nothing can get chat message.
Is there something what I do wrong way?
What I do to scrap chat message?