千里之行条摸,始于足下,今天是第9/1000步铸屉。
“雙微一抖”基本算是目前新媒體矩陣的標(biāo)準(zhǔn)配置钉蒲,所以我們?cè)谧龈?jìng)品調(diào)研或行業(yè)分析時(shí),免不了要去分析一下對(duì)方的微博賬號(hào)彻坛。
一顷啼、常規(guī)分析
對(duì)于微博,我們首先會(huì)對(duì)它進(jìn)行一個(gè)常規(guī)分析昌屉,主要包括:
1钙蒙、粉絲數(shù)、微博數(shù)间驮。
2躬厌、關(guān)注對(duì)方主要發(fā)哪方面的內(nèi)容,一般來(lái)說(shuō)做的好的微博都會(huì)有自己固定的話題竞帽,可以把這些話題梳理出來(lái)扛施。接下來(lái)就是分析內(nèi)容的類型,轉(zhuǎn)發(fā)占多少屹篓,原創(chuàng)內(nèi)容占多少疙渣。
3、第二個(gè)就是微博的形式抱虐,看是以圖文為主昌阿,還是視頻為主。
4、看每天發(fā)文的頻次懦冰,大致的時(shí)間點(diǎn)灶轰。
5、觀察是否建立了微博粉絲群刷钢,是否開通了微博問答(V+付費(fèi)問答)等功能笋颤。醫(yī)療行業(yè)的還可以看他是否開通了愛問診室。
二内地、數(shù)據(jù)分析
數(shù)據(jù)分析又包括兩塊:粉絲分析和博文分析伴澄。
1、粉絲分析
這個(gè)可以借助工具BlueMC來(lái)進(jìn)行阱缓,我們將在下篇文章重點(diǎn)介紹非凌。
2、博文分析
主要包括微博的閱讀數(shù)荆针、轉(zhuǎn)(發(fā))評(píng)(論)(點(diǎn))贊數(shù)敞嗡,因?yàn)殚喿x數(shù)看不到,我們可以通過轉(zhuǎn)評(píng)贊數(shù)來(lái)衡量航背。另外喉悴,還可以利用NLPIR工具對(duì)微博內(nèi)容進(jìn)行定量的詞頻和情感分析。但是在這之前玖媚,我們首先得利用爬蟲把所有微博內(nèi)容爬取下來(lái)箕肃,根據(jù)之前的文章介紹,可以使用WebScraper來(lái)實(shí)現(xiàn)這個(gè)目的今魔。
使用西瓜助手和WebScraper免費(fèi)獲取公眾號(hào)歷史文章
網(wǎng)頁(yè)數(shù)據(jù)抓取工具勺像,webscraper 最簡(jiǎn)單的數(shù)據(jù)抓取教程,人人都用得上
本文不再介紹WebScraper的基礎(chǔ)用法涡贱,如果有問題大家可以參考上面兩篇文章咏删。我將重點(diǎn)分析一下抓取微博的一些注意事項(xiàng)。
1)頁(yè)面加載
微博的數(shù)據(jù)加載邏輯稍微有點(diǎn)復(fù)雜问词,首先每個(gè)頁(yè)面默認(rèn)只顯示一部分督函,需要加載數(shù)次后才能顯示完整,然后才是分頁(yè)加載第2激挪、3...n頁(yè)辰狡。
因此,我們首先需要建立一個(gè)Type為“Element scroll down”的元素垄分,然后在它下面添加時(shí)間宛篇、內(nèi)容、轉(zhuǎn)發(fā)數(shù)薄湿、評(píng)論數(shù)和點(diǎn)贊數(shù)叫倍。
2)分頁(yè)
因?yàn)樯婕暗椒猪?yè),所以我們需要在“Start URL”中利用正則表達(dá)式來(lái)獲取多頁(yè)吆倦,但是我們注意到微博第一頁(yè)的URL和后面頁(yè)的URL不一樣听诸,導(dǎo)致我們無(wú)法一次性獲取所有頁(yè)數(shù)據(jù),因此采取一個(gè)變通的方法蚕泽,單獨(dú)為第一頁(yè)創(chuàng)建一個(gè)sitemap晌梨,然后為第2-n頁(yè)再創(chuàng)建一個(gè)sitemap,抓取兩次须妻。
以@人民日?qǐng)?bào)微博為例仔蝌,第一頁(yè)URL:
????https://weibo.com/p/1002062803301701/home?profile_ftype=1&is_all=1#_0
第二頁(yè)URL:
????https://weibo.com/p/1002062803301701/home?is_search=0&visible=0&is_all=1&is_tag=0&profile_ftype=1&page=2#feedtop
對(duì)應(yīng)的sitemap里的“Start URL”(只抓取2-10頁(yè))是:
https://weibo.com/p/1002062803301701/home?is_search=0&visible=0&is_all=1&is_tag=0&profile_ftype=1&page=[2-10]#feedtop
至此,我們就能順利把微博的數(shù)據(jù)抓取下來(lái)荒吏。下面分別是第一頁(yè)和第2-10頁(yè)對(duì)應(yīng)的sitemap敛惊,有需要的可以直接導(dǎo)入,F(xiàn)YI绰更。
{"_id":"peopledaily","startUrl":["https://weibo.com/p/1002062803301701/home?profile_ftype=1&is_all=1#_0"],"selectors":[{"id":"weibo","type":"SelectorElementScroll","selector":"div.WB_cardwrap.WB_feed_vipcover:nth-of-type(n+3)","parentSelectors":["_root"],"multiple":true,"delay":"3000"},{"id":"DATE","type":"SelectorText","selector":"div.WB_detail:nth-of-type(3) > div.WB_from a.S_txt2:nth-of-type(1)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"CONTENT","type":"SelectorText","selector":"div.WB_feed_detail:nth-of-type(1) div.WB_text.W_f14","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"TRANS","type":"SelectorText","selector":"div.WB_feed_handle:nth-of-type(2) li:nth-of-type(2) em:nth-of-type(2)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"comment","type":"SelectorText","selector":"div.WB_feed_handle:nth-of-type(2) li:nth-of-type(3) em:nth-of-type(2)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"rank","type":"SelectorText","selector":"div.WB_feed_handle:nth-of-type(2) li:nth-of-type(4) em:nth-of-type(2)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0}]}
{"_id":"peopledaily2-n","startUrl":["https://weibo.com/p/1002062803301701/home?is_search=0&visible=0&is_all=1&is_tag=0&profile_ftype=1&page=[2-10]#feedtop"],"selectors":[{"id":"weibo","type":"SelectorElementScroll","selector":"div.WB_cardwrap.WB_feed_vipcover:nth-of-type(n+2)","parentSelectors":["_root"],"multiple":true,"delay":"3000"},{"id":"DATE","type":"SelectorText","selector":"div.WB_detail:nth-of-type(3) > div.WB_from a.S_txt2:nth-of-type(1)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"CONTENT","type":"SelectorText","selector":"div.WB_feed_detail:nth-of-type(1) div.WB_text.W_f14","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"TRANS","type":"SelectorText","selector":"div.WB_feed_handle:nth-of-type(2) li:nth-of-type(2) em:nth-of-type(2)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"comment","type":"SelectorText","selector":"div.WB_feed_handle:nth-of-type(2) li:nth-of-type(3) em:nth-of-type(2)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0},{"id":"rank","type":"SelectorText","selector":"div.WB_feed_handle:nth-of-type(2) li:nth-of-type(4) em:nth-of-type(2)","parentSelectors":["weibo"],"multiple":false,"regex":"","delay":0}]}
不積跬步豆混,無(wú)以至千里,先邁出它10步动知。
轉(zhuǎn)載說(shuō)明:本文為“三少爺?shù)囊姟痹瓌?chuàng)文章,轉(zhuǎn)載請(qǐng)務(wù)必注明出處员辩。