public static @NotNull List<String> parsePyPIListFromWeb(@NotNull String url) throws IOException {
    LOG.info("Fetching index of all packages available on " + url);
    RequestBuilder builder = HttpRequests.request(url).userAgent(getUserAgent());

    PyPackageRepositories service = ApplicationManager.getApplication().getService(PyPackageRepositories.class);
    service.getRepositories().stream()
      .filter(repo -> url.equals(repo.getRepositoryUrl()))
      .findFirst()
      .ifPresent(repository -> PyPackageRepositoryUtil.withBasicAuthorization(builder, repository));

    return builder.connect(request -> {
      final List<String> packages = new ArrayList<>();
      final Reader reader = request.getReader();
      new ParserDelegator().parse(reader, new HTMLEditorKit.ParserCallback() {
        HTML.Tag myTag;

        @Override
        public void handleStartTag(@NotNull HTML.Tag tag, @NotNull MutableAttributeSet set, int i) {
          myTag = tag;
        }

        @Override
        public void handleText(char @NotNull [] data, int pos) {
          if (myTag != null && "a".equals(myTag.toString())) {
            String packageName = String.valueOf(data);
            if (packageName.endsWith("/")) {
              packageName = packageName.substring(0, packageName.indexOf("/"));
            }
            packages.add(packageName);
          }
        }

        @Override
        public void handleEndTag(@NotNull HTML.Tag t, int pos) {
          myTag = null;
        }
      }, true);
      return packages;
    });
  }
public static @NotNull List<String> parsePyPIListFromWeb(@NotNull String url)