Hi, Below is an extract from an html page I was working with
<span>
<span class="nice-name">
NIFTY OCT 11200 CE
</span>
</span>
I have some code extract like below(Did not put python tags as I am not attaching complete code)
browser = webdriver.Chrome(executable_path=r"C:\Users\Admin\Downloads\chromedriver_win32\chromedriver.exe",options=options)
itm = browser.find_elements_by_class_name('nice-name')
print(itm.text)
print(itm.get_attribute('tag'))
For the print statements I am getting output as below
NIFTY OCT 11200 CE
None
Instead of None for the tag, I was expecting it to print 'span'.
How can I get the tag of the element printed? I was trying to do this to debug some code.
Please help.
<span>
<span class="nice-name">
NIFTY OCT 11200 CE
</span>
</span>
I have some code extract like below(Did not put python tags as I am not attaching complete code)
browser = webdriver.Chrome(executable_path=r"C:\Users\Admin\Downloads\chromedriver_win32\chromedriver.exe",options=options)
itm = browser.find_elements_by_class_name('nice-name')
print(itm.text)
print(itm.get_attribute('tag'))
For the print statements I am getting output as below
NIFTY OCT 11200 CE
None
Instead of None for the tag, I was expecting it to print 'span'.
How can I get the tag of the element printed? I was trying to do this to debug some code.
Please help.