0

I am running a script with Selenium, Firefox headless in my linux server. It is running well for my server. But I cannot install/configure the same thing for another one. I am getting this error for my python script:

Traceback (most recent call last):
  File "cde.py", line 290, in <module>
    acde.Run()
  File "cde.py", line 76, in Run
    self.driver.get(self.link_to_explore)
  File "/home/dev/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 213, in get
    self.execute(Command.GET, {'url': url})
  File "/home/dev/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 199, in execute
    response = self.command_executor.execute(driver_command, params)
  File "/home/dev/.local/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 395, in execute
    return self._request(command_info[0], url, body=data)
  File "/home/dev/.local/lib/python2.7/site-packages/selenium/webdriver/remote/remote_connection.py", line 426, in _request
    resp = self._conn.getresponse()
  File "/usr/lib/python2.7/httplib.py", line 1127, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 417, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''

May be I am missing to install something dependency. Is it possible to clone the configuration for certain app and use same in another machine ?

rhb
  • 1
  • Same versions of python? – OneCricketeer Feb 11 '16 at 07:20
  • @cricket_007 yeah python 2.7.9 – rhb Feb 11 '16 at 07:23
  • You could `pip freeze > requirements.txt` on the machine where it is working then move that file over, then do `pip install -r requirements.txt` on the other. That will give you the same dependencies, but it looks like the error is contained in `httlib`. Are you calling the exact same URL? – OneCricketeer Feb 11 '16 at 07:29
  • no different URL. I am facing this error at random time. I even tried with different links which worked for the current machine. .. i think something is wrong with my selenium driver/Firefox version or may be configuration ?? – rhb Feb 11 '16 at 07:33
  • Well, just a simple HEAD request to a web server should give you a status line. If the status line is "bad", then it can't be parsed. If you get the error at random times, then the server is probably messed up – OneCricketeer Feb 11 '16 at 07:36
  • I see. do u think if i handle the BadStatusLine Exception, it might work ? – rhb Feb 11 '16 at 07:45

0 Answers0