Version 11 introduces URLRead
(and others) to replace URLFetch
, but I have run into a strange problem while trying to switch to the new function.
These two both work:
URLFetch["http://www.nottingham.ac.uk/physics/"]
URLRead["http://www.nottingham.ac.uk/physics/"]
But whereas
URLFetch["http://www.nottingham.ac.uk/~ppzphy/"]
successfully loads another page on the same server, this one
URLRead["http://www.nottingham.ac.uk/~ppzphy/"]
gives a 404 error (on my machine, running Mathematica 11.0 on Windows 7).
I had suspected that the problem was the ~
in the second URL, but replacing it by %7E
does not work, and other pages with ~
can be loaded:
URLRead["https://www.cs.tut.fi/~jkorpela/tilde.html"]
Other functions such as Import
work fine with these addresses.
Update to summarize the answers: This seems to be a combination of a problem with the server setup, so that ~
and %7E
are treated as distinct, and inconsistent URLEncode
-ing behavior of URLRead
.
URLFetch
andURLRead
works. (Fetch returns the page, Read returns 200-OK, clicking the green button shows the exact same redirect page source) (Mathematica 11.0 from EU/Hungary) $\endgroup$