我想要一本關於網頁排名項目工作中不封閉。我想做一個索引(字典),看起來像這樣:抓取和分析文本標記
file1.html -> [[cat, ate, food, drank, milk], [file2.html, file3.html]]
file2.html -> [[dog, barked, ran, away], [file1.html, file4.html]]
獲取鏈接很容易 - 查找錨標籤。我的問題是 - 我如何獲取文本? HTML文件中的文本不包含在<p>
之類的任何標籤中。
這裏的輸入HTML文件的一個示例:
d_9.html
d_3.htmlbedote charlatanism nondecision帕德西Antaean HAEC euphoniously Bixa細菌學欲言又止Hobbist petrosa emendable counterembattled高貴hornlessness chemolyze痰盂烙鐵formalith wreathingly hematospermatocele theosophically襯板nontruth possessionist重力matico unlawly abator hyetological Microconodon supermuscan
也許,上面的文字是不是HTML,但後來我如何獲取和分析呢?有任何想法嗎?