0

Anyone have any advice for locating elements on python anywhere using xvfb-run ? I get the driver up and display using the following code but when I try and locate an element by path I get cannot find element. This code works fine on my local machine. The driver does successfully navigate to lmcu.org when I print the url of the browser.

from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0,size=(800,600))
display.start()
browser = webdriver.Firefox()
browser.get("http://www.lmcu.org")
usr = browser.find_element_by_xpath(".//*[@id='LoginName']")
GoBlue_MathMan
  • 1,048
  • 2
  • 13
  • 20

1 Answers1

2

A useful debugging tool is to print the body text of the page you're looking at so you can verify that you're getting the page that you expect.

Glenn
  • 7,262
  • 1
  • 17
  • 23
  • 1
    answer found….Pythonanywhere only allows you to access the elements from their whitelist* websites. Need to upgrade my account. Thanks. – GoBlue_MathMan Oct 22 '15 at 17:03