It looks like Import
has trouble with the character encoding on my computer:
Import["http://hq.sinajs.cn/list=sh601006", "HTML"]
(* "var hq_str_sh601006="`óÇØÌú·,13.13,12.87,13.37,13.77,12.95,13.38, [...] ;" *)
We can find the encoding by looking at the HTML headers:
Grid@URLFetch["http://hq.sinajs.cn/list=sh601006", "Headers"]
Cache-Control no-cache
Content-Length 239
Connection Keep-Alive
Content-Type application/x-javascript; charset=GBK
"GBK"
is not one of the possible $CharacterEncodings
. We can try all possible encodings to see if any work:
Grid[Table[{e,
Import["http://hq.sinajs.cn/list=sh601006", "Text",
CharacterEncoding -> e]}, {e, $CharacterEncodings}]]
I find that "CP936"
and "MacintoshChineseSimplified"
work:
Import["http://hq.sinajs.cn/list=sh601006", "HTML", CharacterEncoding -> "CP936"]
(* var hq_str_sh601006="大秦铁路,13.13,12.87,13.37,13.77,12.95,13.38,13.39 [...] "; *)