python read text from table scraping
Question: I need a value from table with website

My Python Code

    
    
    import sys
    import getopt
    import linecache
    import string
    import ftplib
    import os
    import requests
    from lxml import html
    import datetime
    page = requests.get(URL)
    tree = html.fromstring(page.content)
    all_id = tree.xpath('//td[@style="display:none> &gt;"]/text()')
    print 'Wszystkie ID:', all_id
    

website Code

    
    
    <td style="display:none">id&gt;277918954,id32&gt;c14f940e3eed6a3871e1e3376048303f,level&gt;0,key_left&gt;0,key_right&gt;0,name&gt;file.png,type&gt;File png,size&gt;139.27 KB,hash&gt;538dd38791b76170ab71feec9ef6fed5</td>
    

I'm view only error, where is problem?


Answer: > `//td[@style="display:none> &gt;"]/text()`

This would not match the presented element, this would:

    
    
    //td[@style="display:none"]/text()
    

Though, this expression does not seem reliable.

To provide you with a reliable locator, we would need to see the complete HTML
of the page, but, given what we have, how about checking that the text _starts
with_ `id`:

    
    
    //td[starts-with(., "id")]/text()
    

