0
$\begingroup$

I failed import an xls file from website in Mathematica but got no problem to download it directly using chrome. Can anyone help me solve the problem? Thanks. The detailed situation is listed as the following:

In[12]:= Import["https://files.datapress.com/london/dataset/cis-commissioned-2011-census-tables/2015-11-16T13:32:06/CT0060 - Passports held (detailed).xls"]

During evaluation of In[12]:= FetchURL::httperr: The request to URL https://files.datapress.com/london/dataset/cis-commissioned-2011-census-tables/2015-11-16T13:32:06/CT0060 - Passports held (detailed).xls was not successful. The server returned the HTTP status code 403 ("Forbidden").

Out[12]= $Failed

$\endgroup$

closed as off-topic by MarcoB, dr.blochwave, Oleksandr R., ilian, Michael E2 Nov 17 '15 at 0:33

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – MarcoB, dr.blochwave, Oleksandr R., ilian, Michael E2
If this question can be reworded to fit the rules in the help center, please edit the question.

2
$\begingroup$

The blanks need to be %20 in a url:

Import["https://files.datapress.com/london/dataset/cis-commissioned-2011-census-tables/2015-11-16T13:32:06/CT0060%20-%20Passports%20held%20(detailed).xls"]

"{ {"Office for National Statistics"}, {""}, {"CT0060 - Passports held (detailed)"} } ..

$\endgroup$
  • $\begingroup$ Thank you, it indeed works! Would it be possible for you to explain it a bit more to me, why changing space to %20 works? $\endgroup$ – llybt008 Nov 16 '15 at 21:08
  • 1
    $\begingroup$ spaces are not permitted in URL's. Your browser is kind enough to fix the error, while mathematica sends out exactly what you keyed in. $\endgroup$ – george2079 Nov 16 '15 at 21:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.