title: XPath/Python - How to get different html tags and text inside a <div>
body: <p>I'm trying to scrape the html content at this url: <a href="http://www.dlib.org/dlib/november14/beel/11beel.html" rel="nofollow">http://www.dlib.org/dlib/november14/beel/11beel.html</a> with this Python sintax:</p>
  
  <pre><code>    s="http://www.dlib.org/dlib/november14/beel/11beel.html"
      content = requests.get(s)
      tree = html.fromstring(content.text)
      titoli = tree.xpath('/html/body/form/table[3]/tr/td/table[5]/tr/td/table[1]/tr/td[2]/h3/text()')
      par = tree.xpath('/html/body/form/table[3]/tr/td/table[5]/tr/td/table[1]/tr/td[2]/p/text()')
      articoli = json.dumps({'titoli':titoli,'contenuti':par})
      print ("Content-type: json")
      print
      print (articoli)
  </code></pre>
  
  <p>The main request is to find a XPath query for return every tags, tags content and text inside the most useful div of the page, you can find it with this path /html/body/form/table[3]/tr/td/table[5] or using a web inspector under the commented line: !-- CONTENT TABLE --.
  With the code i've posted before is not possible to get the entire content of the div but only titles and text inside the p div, now i can't find another way.</p>