Java - Downloading Wikipedia Articles
Advice 1

urlName = "https://en.wikipedia.org/wiki/";


I suggest you make that magic string a static constant:

private static final String WIKIPEDIA_MAIN_URL =
        "https://en.wikipedia.org/wiki/";


Advice 2

for(int i = 0; i &lt; urlComponents.length; i++) {
    ...


According to (common) Java coding conventions there must be a single space between for and the opening brace:

for (int i ...
   ^


Advice 3

for (int i = 0; i &lt; urlComponents.length; i++) {


may be written as

for (String urlComponent : urlComponents) {


Advice 4

for(int i = 0; i &lt; urlComponents.length; i++) {
    urlName += urlComponents[i];
    urlName += "_";

    nameOfArticle += urlComponents[i];
    nameOfArticle += " ";
}
urlName = urlName.substring(0, urlName.length() - 1);
nameOfArticle = nameOfArticle.substring(0, nameOfArticle.length() - 1);


You are essentially repeating yourself; I would do this instead:

StringBuilder stringBuilder = new StringBuilder();
String separator = "";

for (String urlComponent : urlComponents) {
    stringBuilder.append(separator).append(urlComponent);
    separator = "_";
}

this.articleName = stringBuilder.toString();
String urlName = WIKIPEDIA_MAIN_URL + stringBuilder.toString();


Advice 5

public void getArticle() {
    try(InputStream inputStream = url.openStream(); Scanner scanner = new Scanner(inputStream)) {
        while(scanner.hasNext()) {
            article += scanner.next() + "\n";
        }
    } catch(IOException e) {
        System.out.println(e);
    }
}


Why read one "word" at a time when you can read an entire line. Also, whenever building such strings, StringBuilder will be much more efficient:

public void getArticle() {
    StringBuilder stringBuilder = new StringBuilder();

    try (Scanner scanner = new Scanner(url.openStream())) {
        while (scanner.hasNextLine()) {
            stringBuilder.append(scanner.nextLine()); // &lt;-- note the builder
        }
    } catch (IOException ex) {
        ex.printStackTrace();
    }

    this.article = stringBuilder.toString();
}


Alternative implementation

Gathering all the advices, I had this in mind:

import java.util.Scanner;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.net.URL;
import java.net.MalformedURLException;

public class ArticleSupplier {

    private static final String WIKIPEDIA_MAIN_URL =
            "https://en.wikipedia.org/wiki/";

    private String articleName;
    private URL url;
    private String article;

    public ArticleSupplier(String[] urlComponents) {
        StringBuilder stringBuilder = new StringBuilder();
        String separator = "";

        for (String urlComponent : urlComponents) {
            stringBuilder.append(separator).append(urlComponent);
            separator = "_";
        }

        this.articleName = stringBuilder.toString();
        String urlName = WIKIPEDIA_MAIN_URL + stringBuilder.toString();

        try {
            this.url = new URL(urlName);
        } catch(MalformedURLException ex) {
            ex.printStackTrace();
        }
    }

    public void getArticle() {
        StringBuilder stringBuilder = new StringBuilder();

        try (Scanner scanner = new Scanner(url.openStream())) {
            while (scanner.hasNextLine()) {
                stringBuilder.append(scanner.nextLine());
            }
        } catch (IOException ex) {
            ex.printStackTrace();
        }

        this.article = stringBuilder.toString();
    }

    public void saveAsHTML() {
        String filename = articleName + ".html";

        try (BufferedWriter writer =
                new BufferedWriter(new FileWriter(filename))) {
            writer.write(article);
        } catch(IOException ex) {
            ex.printStackTrace();
        }
    }

    public static void main(String[] args) {
        ArticleSupplier as = new ArticleSupplier(args);
        as.getArticle();
        as.saveAsHTML();
    }
}