How do you access a text in an XPath if it doesn't have a node? The text is in quotation marks and on seperate line inside another node
I'm having trouble choosing the correct element in an XPath
<span>
<a href="www.imagine_a_link_here.org">
"
This is the text I need to access
"
</a>
</span>
I'd normally do this by writing
import requests
from lxml import html,etree
from lxml.html import document_fromstring
page = requests.get('https://www.the_link_im_trying_to_webscrape.org')
tree = html.fromstring(page.content)
the_text_i_need_to_access_xpath = '/span/a/text()'
the_text_i_need_to_access = tree.xpath(the_text_i_need_to_access_xpath)
Unfortunately this is only returning an empty list. Does anyone know how I have to modify the XPath in order to get the string I'm looking for?