0

I want to automate the navigation of a page, scan its QR code and then interact with it.

I am doing this with selenium and python.

But I don't see any display to scan the QR code,

this is how my code begins:

from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

display = Display(visible=0, size=(800, 600))
display.start()
browser = webdriver.Chrome()

What shall I do to see the display and scan QR code and resume the program?

I read examples of using Selenium on Windows in which the browser shows up automatically.

1
  • 1
    Is this a headless server? What happens when the last line executes? Commented Jul 2, 2016 at 2:59

1 Answer 1

2

The reason is that you are using a virtual display ( i.e. headless browser ), remove these two lines and you must be able to see the browser.

display = Display(visible=0, size=(800, 600))
display.start()

Since you don't need the virtual display, remove the first line as well.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.