In this case, it doesn’t quite matter whether it’s d3.html or d3.text - to load any data from one webpage to another, you’ll need the resource to support CORS. Wikipedia doesn’t, for its webpages, because they’re typically consumed by browsers, not loaded by JavaScript. Here’s an example of loading that page:
There are two options that work - either pulling from Wikipedia through a proxy that adds CORS, or by pulling from the Wikipedia API.
Most of the time, when you’re loading things with JavaScript, CORS will be supported and what you’re loading is data. Webpages aren’t usually regarded as data, and usually don’t support CORS - they’re pretty tricky to parse, as this one is - if your intent is to get that list of towns a boroughs. That’s also why, for data in Wikipedia, there’s Wikidata, a sister project that provides better APIs and easier-to-use data. Unfortunately it doesn’t have coverage for this particular table.
Anyway, best of luck, and also threw in the code for parsing the entries from that table in that notebook.