I'm creating python project which goal is to extract some data from estate portal. I work in python and I use selenium package. To find elements I use Xpath's .
Generally every works fine but when i try to extract text of span i encounter a problem.
span's html:
<span class="some-class">
<svg width="1em" height="1em" viewBox="0 0 24 24" xmlns="http://www.ty.org/1000/svg" class="other-some-class">
<path d="some-path" fill="currentColor" fill-rule="evenodd">
</path>
</svg>
text to scrap
</span>
I extract this span using xpath .
my_obj = i.find_element(By.XPATH, './div/div/div[2]/div[3]/div/span'
I think it is correct because it returns selenium object and when i try to get class attribute using:
print('my_obj',my_obj.get_attribute('class'))
it returns correct class some-class
My problem is that's i cannot extract text of this span. I mean text to scrap
.
I think i have tried everything .
my_obj.text
my_obj.get_attribute('innetText')
my_obj.get_attribute('textContent')
my_obj.get_attribute('innerHTML')
These obove doesnt't work.
Any Idea whats's I 'm doing wrong?