# Web Scraping - Why are these numbers interpreted as strings?

I started with:

data = Import["https://www.destatis.de/DE/ZahlenFakten/GesellschaftStaat/Gesundheit/Todesursachen/Tabellen/Sterbefaelle_Unfaelle.html", "Data"]


Then extracted the data I needed with:

alter01b = data[[3,3, 4, 1, 2]]
alter02b = data[[3,3, 4, 2, 2]]
alter03b = data[[3,3, 4, 3, 2]]
alter04b = data[[3,3, 4, 4, 2]]
alter05b = data[[3,3, 4, 5, 2]]
alter06b = data[[3,3, 4, 6, 2]]
alter07b = data[[3,3, 4, 7, 2]]
alter08b = data[[3,3, 4, 8, 2]]
alter09b = data[[3,3, 4, 9, 2]]
alter10b = data[[3,3, 4, 10, 2]]
alter11b = data[[3,3, 4, 11, 2]]


And it gave me this:

21
67
86
706
800
800
1 394
1 787
2 436
6 727
9 738

The numbers with a whitespace (1 394 and onwards) are not regarded as such even when I remove the whitespace.

Can anyone help?

• Please try If[StringQ[#], FromDigits[StringDelete[#, WhitespaceCharacter]], #] & /@ data[[3, 3, 4, All, 2]]. Commented Mar 8, 2019 at 9:30

ReplaceAll[

The ReplaceAll can of course also be represented as data[[3, 3, 4, All, 2]] /. s_String :> FromDigits[StringDelete[s, " "]], if preferred.