diff --git a/testing/web-platform/tests/html/tools/build.sh b/testing/web-platform/tests/html/tools/build.sh
index 4453604433c021..21403090b8e1df 100755
--- a/testing/web-platform/tests/html/tools/build.sh
+++ b/testing/web-platform/tests/html/tools/build.sh
@@ -5,6 +5,8 @@ cd "${0%/*}"
virtualenv -p python .virtualenv
.virtualenv/bin/pip install genshi
git clone https://github.com/html5lib/html5lib-python.git .virtualenv/html5lib && cd .virtualenv/html5lib || cd .virtualenv/html5lib && git pull
+# Pinned commit, to avoid html5lib from changing underneath us.
+git reset --hard d49afd350c06339a8c59299664b8a73a3b2c3f64
git submodule update --init --recursive
cd ../..
.virtualenv/bin/pip install -e .virtualenv/html5lib