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?