一段RUBY的脚本,分析姓名的分数,本来没甚么难的,就是ruby1.91的编码问题,导致一堆问题。

require 'net/http' require 'iconv' http = Net::HTTP.new("www.1518.com",80) resp, data = http.get("/s?st=2&word1=韩&word2=乐萱&Submit=%BF%AA%CA%BC%B2%E2%CB%E3") aa = Iconv.conv("utf-8//IGNORE","gbk",data) a = /<div class="njfen">(/d+)<div>/.match(aa) puts a[1]

你可能感兴趣的:(脚本,Class,Ruby)