Python Webdriver raises http.client.BadStatusLine error
<p>I'm writing a parser and I'm using Selenium Webdriver. So, I have this <a href="https://repl.it/Dgtp" rel="nofollow">https://repl.it/Dgtp</a> code and it's working fine until one random element and throws following exception:
http.client.BadStatusLine: ''<br>
Don't know how to fix it at all. Help.</p>

<p><strong>[UPD]</strong></p>

<p>I tried to scroll the page via webdriver (it had to cause thumbnails to load) and got this <a href="https://repl.it/DkiX" rel="nofollow">https://repl.it/DkiX</a> error series. It would be caused by HTTP error from one of images which were loading, but I've not found any loading errors on the page. Still searching the answer.</p>

<p>This is a <code>urllib</code> problem. This happens most commonly in python3. What it means is that the status code that the server returned isn't recognized by the http library. Sometimes the server doesn't receive the request at all and the status code returns an empty string triggering that error. </p>

<p><strong>How to fix</strong></p>

<p>Check if the URL string has a trailing newline character. Make sure that your URLs are stripped of any leading or trailing special characters. More info <a href="http://stackoverflow.com/questions/1767934/why-am-i-getting-this-error-in-python-httplib">here</a></p>

<p>If everything looks fine with the URL just treat the exception</p>

<pre><code>import http
try:
    browser.get(MONTHLY_URL)
except http.client.HTTPException as e:
    print e
</code></pre>

python django selenium webdriver phantomjs