On Friday, 9 January 2015 at 17:15:43 UTC, Adam D. Ruppe wrote:
import arsd.dom;
import std.net.curl;
import std.stdio, std.algorithm;
void main() {
auto document = new Document(cast(string)
get("http://www.stroustrup.com/C++.html"));
writeln(document.querySelectorAll("a[href]").map!(a=>a.href));
}
Or perhaps better yet:
import arsd.dom;
import std.net.curl;
import std.stdio;
void main() {
auto document = new Document(cast(string)
get("http://www.stroustrup.com/C++.html"));
foreach(a; document.querySelectorAll("a[href]"))
writeln(a.href);
}
Which puts each one on a separate line.
Both these code examples triggers the same assert()
dmd: expression.c:3761: size_t StringExp::length(int): Assertion
`encSize == 1 || encSize == 2 || encSize == 4' failed.
on dmd git master. Ideas anyone?