selenium - Retrieving the Object of a Python List Instead of the Address -


I am trying to retrieve the information listed in the drop-down box on a webpage. Objects represent different configurations I would like to store the contents of the list & amp; So do a search to see if the file I want is listed there. Here's what the code from that part of the web page looks like:

  & lt; Form id = "fileupload" action = "/ files / upload /" method = "post" enctype = "multipart / form-data" & gt; & Lt; Div class = "page-header" & gt; & Lt ;! - & lt; H1 & gt; User files & lt; / H1> - & gt; & Lt; Div class = "form-inline pull-right" style = "line-height: 36px" & gt; & Lt; Span class = "help-inline" & gt; Active Configuration: & lt; / Span & gt; & Lt; Select id = "active_config" & gt; & Lt; Options & gt; Any & lt; / Option & gt; & Lt; Options & gt; Examples: NCD & lt; / Options & gt; & Lt; Options & gt; class. NCD & lt; / Options & gt; & Lt; Options & gt; Sting.ncd & lt; / Options & gt; & Lt; Options & gt; MyTestConfig.ncd & lt; / Options & gt; & Lt; Option selected = "selected" & gt; Vacation.ncd & lt; / Options & gt; & Lt; Options & gt; Reital.NCD & lt; / Option & gt; & Lt; / Select & gt;  

Therefore, I counted the items listed in the drop-down box ...

  NumberOfConfigFiles = len (driver.find_elements_by_xpath ("// select [ Id = 'active_config'] / options "))  

Then I have stored the list in a variable ...

  configList = driver.find_elements_by_xpath ("// [[ID = 'active_config'] / select the option")  

I have a problem here i ... When I ... configList [0] < Recovering items in configList using / code>, configList [2] , configList , etc. Do Ryas. Instead of returning the object, it appears to return information about the object.

  [& lt; Selenium.webirdier.remote.vabelement Web Element Object 0x02D9EC50 & gt ;, & lt; Selene Um.Vibriador.Remote.Vevelopment 0x02DB23B0 & gt;, & lt; Selenium.webread iver.remote.webelement.WebElement object at 0x02DB23F0>, & lt; 0x02DB2710>, & lt; selenium.webdriver.rem ote.webelement.WebElement Object Object on selenium.webdriver.remote.webe 0x02DB20F0>, & lt; EbElement object at lement.WebElement Object 0x02DB2390 at selenium.webdriver.remote.webelement.We & gt ;, & lt; Selenium.webdriver.remote.webelement.WebElemenT object 0x02DB2410 & gt;]  

Considering this list, I want the object & amp; I had stored them properly, how do I get it to get the address instead of the object?

You can iterate on the list and the methods like .text etc You can call. Which are relevant to what you want from each object stored in the list.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -