[問題] 請問抓網頁並去除html tag後 出現亂碼?

看板Perl作者 (努力吧)時間17年前 (2007/10/25 01:05), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/5 (看更多)
請問各位高手們 我將某一網頁抓下來 並用regular去除 html tag 但顯示的結果竟然變成亂碼,但有些網頁沒出現亂碼,有些則有...@@ (還是去除tag前要加什麼?) 請問有人知道解決方案嗎 感謝~~ 程式碼---------------------------------------------------------- use WWW::Mechanize; my $mech = WWW::Mechanize->new(); my $http="http://blog.roodo.com/judie35/archives/270979.html"; $mech->get($http); my $html=$mech->content(); foreach ($html){ s/<[^>]*>//g;} print $html; -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.25.10.78 ※ 編輯: senhuo 來自: 163.25.10.78 (10/25 01:08) ※ 編輯: senhuo 來自: 163.25.10.78 (10/25 01:09)
文章代碼(AID): #177tjWxY (Perl)
文章代碼(AID): #177tjWxY (Perl)