I can get some information by

data=Import["http://xxxx/xxx/xxxx", "XMLObject"];

Then I can get some informatin by Case function, just like th following:

Cases[data, XMLElement[
"a", {___, "href" -> s_}, {___, 
 XMLElement["span", {___}, {___}], ___, 
 XMLElement["span", {___}, {___}], ___}] :> {s}, {0, Infinity}];

After that, I save "data" in a .txt file, by


But I want to reanalysis those data, so I import the data.txt, (I think it convenient for use),

data = Import["data.txt"]

but it don't work when I use Case function again. I don't know why, I hope someone can help me, thanks.

  • 1
    $\begingroup$ data.txt was saved as plain text. Mathematica will therefore import it as a String. Export to data.m or specify the export format and import formats. $\endgroup$ – b3m2a1 Nov 17 '17 at 15:39
  • $\begingroup$ @b3m2a1 Thank you, I tried xml format, it is good. $\endgroup$ – zongxian Nov 17 '17 at 15:41

Browse other questions tagged or ask your own question.