0

I want to get some text from a web page with selenium but when I use the pyvirtualdisplay package and I write code like this:

from pyvirtualdisplay import Display 
display = Display(visible=0, size=(1024, 768))
display.start()
...
elem = browser.find_element_by_css_selector('...').text
print elem
...

it prints an empty string. If I don't use pyvirtualdisplay, doing the same things, it works fine and displays the right string. Why does this happen and how can I solve?

StackUser
  • 1,530
  • 3
  • 13
  • 17
  • What browser are you using? Is this not a headless environment? – Levi Noecker Sep 23 '16 at 02:46
  • I solved using chrome instead of firefox... I don't know why but today firefox (with selenium) stopped working: when I use browser.get('url') it open a firefox windows but doesn't run the URL. Any explanation? – StackUser Sep 23 '16 at 10:50

0 Answers0