Home > Back-end >  Scrape text mixed with emojis with rvest
Scrape text mixed with emojis with rvest

Time:08-15

I'm trying to scrape live chats from Youtube streaming. I can use rvest's html_text() to get the texts and I can also use html_attr("shared-tooltip-text") to get the emojis. For my data, I can then combine them by putting the emojis behind the text to create a text string. HOWEVER, I can't figure out how to get the text and emojis in the order they appear in the original message.

Here is a sample chat message below

<span id="message" dir="auto" >

"text pt1"

<img  src="https://www.youtube.com/s/gaming/emoji/0f0cae22/emoji_u1f49b.svg" alt="           
  • Related