我从这里找到了bat文件:
http://www.dostips.com/DtCodeBatchFiles.php#Batch.FindAndReplace
我想在这个蝙蝠之后运行另一个命令,但它不起作用.我想网站提供的代码一定有问题.任何人都可以给我一个线索?谢谢.
我用Nokogiri来解析一个HTML.我需要页面中的内容和图像标签,所以我使用inner_html而不是content方法.但返回的值content编码正确,而错误编码inner_html.需要注意的是,该页面是中文的,不使用UTF-8编码.
这是我的代码:
# encoding: utf-8
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'iconv'
doc = Nokogiri::HTML.parse(open("http://www.sfzt.org/advise/view.asp?id=536"), nil, 'gb18030')
doc.css('td.font_info').each do |link|
# output, correct but not i expect: ????????
puts link.content
# output, wrong and not i expect: <img ....></img>???????????????????
# I expect: <img ....></img>????????
puts link.inner_html
end
Run Code Online (Sandbox Code Playgroud)