Sunday, 15 January 2012

Python script hangs on ubuntu server using selenium firefox driver -



Python script hangs on ubuntu server using selenium firefox driver -

i'm trying take screenshots of webpages. opted selenium , firefox. i'm using xvfb , setting environment variable display.

the script works fine without xvfb on os x desktop. on server script hangs after webdriver.firefox() issued if python script no longer executing. no exception ever raised , firefox still active in process list.

setup:

sudo xvfb :10 -ac export display=:10

test.py

from selenium import webdriver print 'start' firefox = webdriver.firefox() print 'hello?' firefox.quit() print 'done!'

output:

start cursor winks tauntingly

i had same problem chrome. tried phantomjs flash fork, successful did not capture flash content.

starting independently firefox gives

(process:3278): glib-critical **: g_slice_set_config: assertion 'sys_page_size == 0' f failed xlib: extension "randr" missing on display ":10". error: access denied while trying open files in profile directory. alsa lib confmisc.c:768:(parse_card) cannot find card '0' alsa lib conf.c:4248:(_snd_config_evaluate) function snd_func_card_driver returned error: no such file or directory alsa lib confmisc.c:392:(snd_func_concat) error evaluating strings alsa lib conf.c:4248:(_snd_config_evaluate) function snd_func_concat returned error: no such file or directory alsa lib confmisc.c:1251:(snd_func_refer) error evaluating name alsa lib conf.c:4248:(_snd_config_evaluate) function snd_func_refer returned error: no such file or directory alsa lib conf.c:4727:(snd_config_expand) evaluate error: no such file or directory alsa lib pcm.c:2239:(snd_pcm_open_noupdate) unknown pcm default (firefox:3278): gconf-warning **: client failed connect d-bus daemon: //bin/dbus-launch terminated abnormally without error message

please help

thanks!

python-2.7 firefox selenium-webdriver ubuntu-13.10

No comments:

Post a Comment