Home > database >  Isolating elements from a specific column using R
Isolating elements from a specific column using R

Time:07-06

I've been experimenting with the TikTok Scraper tool (https://github.com/drawrowfly/tiktok-scraper/) for a little while and, while I'm not a expert, I've been using R for some of the more simples analysis of the scraped data, but I've experiencing issues with the hashtags scraping.

Whenever I scrape data from, let's say, an specific hashtag, I receive data in a format that's not very suitable for my work, for instance:

***[{"id":"1662240138893317","name":"globolixoo","title":"","cover":""},{"id":"56170","name":"mentira","title":"","cover":""}]***

All that interests to me are the terms that come after "name": — that is, 'globolixoo' and 'mentira'.

Is there any way in which I can isolate these terms and separate them by comma (globolixoo,mentira)?

Reproducible code example:

    dput(head(globolixoo, 10)

    structure(list(id = c(6808536063938710528, 6814233256737786880, 
6825734509393103872, 6945455970969488384, 6949635086916635648, 
6970340938765978624, 6971908200639630336, 6973074032547613696, 
6973112184809212928, 6973333129226505216), secretID = c(6808536063938710528, 
6814233256737786880, 6825734509393103872, 6945455970969488384, 
6949635086916635648, 6970340938765978624, 6971908200639630336, 
6973074032547613696, 6973112184809212928, 6973333129226505216
), webVideoUrl = c("https://www.tiktok.com/@aguiarsillvabarbe/video/6808536063938710790", 
"https://www.tiktok.com/@deysetavares77/video/6814233256737787141", 
"https://www.tiktok.com/@davinunesrocha1988/video/6825734509393104134", 
"https://www.tiktok.com/@fernandomedeiros84/video/6945455970969488646", 
"https://www.tiktok.com/@marcoaaspm/video/6949635086916635909", 
"https://www.tiktok.com/@diverticity/video/6970340938765978885", 
"https://www.tiktok.com/@erick.castrooficial/video/6971908200639630597", 
"https://www.tiktok.com/@dublagem19/video/6973074032547613958", 
"https://www.tiktok.com/@dublagem19/video/6973112184809213189", 
"https://www.tiktok.com/@dublagem19/video/6973333129226505478"
), text = c("#GloboLixoo", "#globolixoo", "#GLOBOLIXOO            
  • Related