wordpress多语言网站,济宁住房和城乡建设厅网站,seo学徒,如何规划电子商务网站我正在尝试将网页源代码读入R并将其作为字符串处理。我正在尝试删除段落并从段落文本中删除html标签。我遇到了以下问题#xff1a;我尝试实现一个功能来删除html标签#xff1a;cleanFunfunction(fullStr){#find location of tags and citationstagLoccbind(str_locate_all(…我正在尝试将网页源代码读入R并将其作为字符串处理。我正在尝试删除段落并从段落文本中删除html标签。我遇到了以下问题我尝试实现一个功能来删除html标签cleanFunfunction(fullStr){#find location of tags and citationstagLoccbind(str_locate_all(fullStr,)[[1]][,1]);#create storage for tag stringstagStringslist()#extract and store tag stringsfor(i in 1:dim(tagLoc)[1]){tagStrings[i]substr(fullStr,tagLoc[i,1],tagLoc[i,2]);}#remove tag strings from paragraphnewStrfullStrfor(i in 1:length(tagStrings)){newStrstr_replace_all(newStr,tagStrings[[i]][1],)}return(newStr)};这适用于某些标签但不适用于所有标签此示例失败的示例是以下字符串testjunk junk junk junk目标是获得cleanFun(test)junk junk junk junk但是这似乎不起作用。我认为这可能与字符串长度或转义字符有关但是我找不到涉及这些的解决方案。