This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
Copied from forum:
string html = get(page, client).text;
auto document = new Document();
document.parseGarbage(html);
Element attEle = document.querySelector("span[id=link2]");
Element aEle = attEle.querySelector("a");
string link = aEle.href; // <-- if the href contains space, it return "href" rather the link
Copied from forum: string html = get(page, client).text; auto document = new Document(); document.parseGarbage(html); Element attEle = document.querySelector("span[id=link2]"); Element aEle = attEle.querySelector("a"); string link = aEle.href; // <-- if the href contains space, it return "href" rather the link
let's say the page HTML look like this:
Hello, dear world! G!
See also https://forum.dlang.org/post/eznreimgzchrwggxtzls@forum.dlang.org