opendir operates on directories on a filesystem, not HTTP URIs.
While some HTTP URIs return directory listings (the one you are using doesn't, it is a 404 error), those listings as HTML documents generated by the webserver and are not actual directories.