 <p>It's not ideal but I compare the page text against following regex since on my setup that text accompanies web page errors: </p> <pre><code>(?:(access is denied)|(access is forbidden)|(server error)|(not found)) </code></pre>