I'm trying to scrape the html content at this url: http://www.dlib.org/dlib/november14/beel/11beel.html with this Python sintax:
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)
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.
parvariable - Zion