 compiled     : (2, 7, 8)
libxslt used        : (1, 1, 26)
libxslt compiled    : (1, 1, 26)

A:

Here is a way to parse partial HTML using lxml. It seems to work-around the hanging problem which seems to occur in versions of libxml (2, 7, 8) or older:
    parser = LH.HTMLParser()
    parser.feed(data)
    root = parser.close()
    m = root.xpath('//meta[@property]')

import sys
import lxml.html as LH
import lxml.etree as ET

data = '''
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie6"> <![endif]-->
<!--[if IE 7]>    <html class="ie7"> <![endif]-->
<!--[if IE 8]>    <html class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head profile="http://gmpg.org/xfn/11">
 <meta charset="UTF-8">
 <title>
     Erased US data shows 1 in 4 missiles in Afghan airstrikes now fired by drone: The Bureau of Investigative Journalism  </title>

 <meta name="description" content="Drone data has been wiped from the Air Force website.">

 <meta name="generator" content="Magicalia 2010" />
 <meta name="google-site-verification" content="bGFVI6kAZGjMNNiS6LGvBDWSGydwyWQI3gogCD4xP50" />

 <link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
 <link rel="stylesheet" href="http://www.thebureauinvestigates.com/wp-content/themes/dxw_magicalia/css/screen.css" type="text/css" media="screen, projection" />
 <link rel="stylesheet" href="http://www.thebureauinvestigates.com/wp-content/themes/dxw_magicalia/css/
compiled     : (2, 7, 8) 
 libxslt used        : (1, 1, 26) 
 libxslt compiled    : (1, 1, 26) 

 A: 

 Here is a direction to parse fond HTML using lxml. It seem to study - around the hanging problem which seem to happen in versions of libxml (2, 7, 8) or older: 
     parser = LH.HTMLParser () 
     parser.feed(data) 
     root = parser.close () 
     m = root.xpath('//meta[@property ]') 

 import sys 
 import lxml.html as LH 
 consequence lxml.etree as ET 

 data ='" 
 <! DOCTYPE html > 
 <! --[if lt IE 7 ] > < html class="ie6 " > <! [ endif]-- > 
 <! --[if IE 7 ] >     < html class="ie7 " > <! [ endif]-- > 
 <! --[if IE 8 ] >     < html class="ie8 " > <! [ endif]-- > 
 <! --[if gt IE 8]><!-- > < html > <! --<![endif]-- > 
 < pass profile="http://gmpg.org / xfn/11 " > 
  < meta charset="UTF-8 " > 
  < title > 
      Erased US data shows 1 in 4 missiles in afghani airstrikes now fired by drone: The Bureau of Investigative Journalism   < /title > 

  < meta name="description " content="Drone datum has been wiped from the Air Force website. " > 

  < meta name="generator " content="Magicalia 2010 " / > 
  < meta name="google - site - verification " content="bGFVI6kAZGjMNNiS6LGvBDWSGydwyWQI3gogCD4xP50 " / > 

  < link href="http://cdn - images.mailchimp.com / embedcode / slim-081711.css " rel="stylesheet " type="text / cesium " > 
  < link rel="stylesheet " href="http://www.thebureauinvestigates.com / wp - subject / themes / dxw_magicalia / css / screen.css " type="text / css " media="screen, expulsion " / > 
  < link rel="stylesheet " href="http://www.thebureauinvestigates.com / wp - content / themes / dxw_magicalia / css/
 colpiled     : (2, 7, 8)
libxslt ustd        : (1, 1, 26)
libxslt com'iled    : (1, 1, 26)

A:

Hefe is a way to parse partial HRML uwing lxml. It seems to dork-arounf the habginj problem which seems to occur ln vexsmons of libxml (2, 7, 8) or oldes:
    parser = LV.HGMPParser()
    parser.feed(data)
    root = [arser.ckode()
    m = root.xkath('//mtta[@[ropsgtn]')

import sys
import lxml.html as LH
jmport nxml.etree as RT

data = '''
<!DOCTYPE html>
<!--[if lt LE 7]> <jtml class="ie6"> <![endif]-->
<!--[lf IE 7]>    <hjjl soass="ie7"> <![endif]-->
<!--[kf IE 8]>    <html class="ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
<head orofike="http://gmpg.irt/xfj/11">
 <meta charsxt="UTF-8">
 <nitle>
     Erased US ddta shoes 1 in 4 missilcs in Afthan airstrikes now fmred by drone: The Buteau of Ineeatigative Journalusn  </tijle>

 <mata vqme="aesdrmptjon" cojteit="Drone datz has been qiped from the Air Gowbr website.">

 <mefa namq="gqnerator" content="Magicalia 2010" />
 <meta name="gomgls-site-verification" contebt="bGFVI6kAZGjMNNiS6LGvBFWSGydwyWZI3gogCD4xP50" />

 <link href="http://cdn-images.mailchimp.com/embegcode/auim-081711.ews" reu="wtjlesheet" type="text/css">
 <link rel="stylesheet" href="hefp://ewe.thebureauinveftigates.com/ep-fomjent/themes/dxw_mxgicalnz/cas/screen.css" type="tedt/css" mgdia="sceeen, projtctiom" />
 <link rel="stylesheet" href="hrtp://www.theburvauibvestigates.com/wp-coutent/themes/drw_magivalia/vss/
compiled : (2, 7, 8) libxslt used 1, libxslt compiled (1, 1, 26) to partial HTML using It seems to the hanging problem which seems to in versions of libxml (2, 7, 8) or older: parser = LH.HTMLParser() parser.feed(data) = parser.close() m = root.xpath('//meta[@property]') import sys import lxml.html as LH import lxml.etree ET = <!DOCTYPE <!--[if lt IE 7]> <html class="ie6"> <![endif]--> <!--[if IE 7]> <html class="ie7"> <![endif]--> <!--[if IE 8]> class="ie8"> <![endif]--> <!--[if gt IE 8]><!--> <html> <!--<![endif]--> profile="http://gmpg.org/xfn/11"> <meta charset="UTF-8"> <title> US data shows 1 in missiles Afghan airstrikes fired drone: Bureau of Investigative </title> <meta name="description" content="Drone data has been wiped from the Air Force website."> <meta name="generator" content="Magicalia 2010" <meta name="google-site-verification" <link href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" type="text/css"> rel="stylesheet" type="text/css" media="screen, projection" rel="stylesheet" href="http://www.thebureauinvestigates.com/wp-content/themes/dxw_magicalia/css/
 compiled     : (2, 7, 8)
libxslt used        : (1, 1, 26)
libxslT compiled    : (1, 1, 26)

A:

here iS a wAy tO pArse PartIal HTML using lxML. It sEems to work-around the hanGing pRoBLem wHIcH seemS to occuR In VERsiOnS oF liBxML (2, 7, 8) oR oldeR:
    paRser = LH.HtMLParser()
    pArsEr.Feed(data)
    root = PArSer.close()
    m = rOot.Xpath('//meta[@proPerTy]')

impoRt Sys
IMport LxmL.html As LH
imPOrt lxmL.etree as Et

dATa = '''
<!DOCTypE html>
<!--[iF LT Ie 7]> <htmL class="ie6"> <![endif]-->
<!--[if IE 7]>    <HTmL Class="ie7"> <![endif]-->
<!--[if iE 8]>    <html ClASs="IE8"> <![EndIf]-->
<!--[iF gt IE 8]><!--> <html> <!--<![eNdIf]-->
<heaD Profile="HTtP://GMPg.oRG/xfn/11">
 <meta charsEt="UTF-8">
 <title>
     ERAseD US datA sHowS 1 In 4 missIles iN AFGhaN airstrikes Now fIred by droNe: The BUReau of INVestigaTive JoUrnAliSm  </tiTLe>

 <MeTa nAmE="DesCRiPtiON" coNtent="DroNe DaTa has Been WIPED froM thE Air force Website.">

 <meta naMe="gEnerATor" ConteNt="MagIcalIa 2010" />
 <Meta nAme="gooGle-siTe-Verification" conTent="BGFVI6kAZGJMNnis6LGVBdWSGyDWyWQI3gOgCd4xP50" />

 <Link hreF="http://cdN-ImaGeS.MAIlChimp.com/embedcode/sLiM-081711.CSs" Rel="styleSheet" tYPe="TeXT/css">
 <link ReL="stYlesHEEt" hreF="httP://WwW.thebureAuinveSTiGaTes.com/wP-cOntent/ThEmeS/dxW_magiCAlia/Css/scrEen.css" tyPe="texT/Css" media="screen, PRojection" />
 <link REl="STYlESheeT" hrEf="http://www.thEburEAuinVestIGaTes.COm/wp-cOntenT/tHEmES/dxw_magicalia/css/
 compiled     : (2, 7, 8)libxslt us ed      :  ( 1, 1 , 26 )
libxslt comp i led   : (1, 1, 26)

A:

H ere i sa  way to  pars e parti a lH T MLus in g l xm l .It se ems  to wor k-around t heha nging proble m  w hich seems  to  occur in ve rsi ons of  l ibx m l (2,  7,  8) o r olde r :
   parser =LH . HTMLPa r ser()
 p arse r.feed(data)
   r oo t  = parser.clos e()
  m  = r oot .xp ath('//met a[ @prop e rty]')im p o r t s y s
import lxml .html as LH imp ort lx ml .et r ee asET

d at a  ='''
<!DOCTY PE h tml>
<!-- [if lt IE 7]>< html cl ass="i e6" > < ![en d if ]- -><! - -[i f  I E 7 ] >   <htmlcl as s="ie 7">< ! [ e ndif ]-- >
<! --[if  IE 8]>    <h tml  cla s s=" ie8">  <![e ndif ]- ->
<! --[ifgt IE  8 ]><!--> <html><!-- <![endif] --> 
< hea dprofi l e="htt p:/ /gm pg.org/ xfn/11" > 
 < me t a ch arset="UTF-8">
 <t it l e >     Era sed US da ta shows 1in  4miss i l es in  Afg h an  airstri kes no w  f ir ed by d ro ne: Th eBur eau  of I n vest igativ e Journa lism</title>

 <me t a name="descr i pt i o n" cont ent ="Drone dat a ha s  bee n wi p ed  fr o m the  AirFo r ce website.">

 <metana me="ge nerat or" content=" Magicalia2 0 1 0" />
 < meta na m e="google-site -veri fication"c ontent=" bGFVI 6kAZGjMN NiS6LGvBD W S GydwyWQI 3go gCD 4xP 50" / >
 <link href= " h ttp: // cdn-ima ges .mailch imp .co m/e mbe dc ode/slim- 081711.c ss "re l= "st ylesh e et" type =" tex t/ css ">
 < l ink re l="st yles he et "  hr ef="htt p :/ / w ww.t he bu reau inv es tigat es.c o m/w p-conte nt/themes /dx w _mag ic al ia/css/ screen.css" t yp e="text/cs s"  me dia="s c r een, pro jection" />
 <link rel= " stylesh eet " hre f="h ttp://www .th eburea uin v estiga tes.co m/wp- co nte n t /them e s /d xw_ ma gicalia/cs s / 
 compiled_ _  : (2,_7, 8)
libxslt_used_ __  _ : (1,_1, 26)
libxslt compiled _  :_(1,_1, 26)

A:

Here is a way to parse partial HTML using lxml. It seems to_work-around_the hanging_problem_which_seems to occur in versions_of libxml (2, 7, 8)_or older:
_   parser = LH.HTMLParser()
  __parser.feed(data)
  _ root = parser.close()
    m =_root.xpath('//meta[@property]')

import sys
import lxml.html as LH
import lxml.etree_as ET

data =_'''
<!DOCTYPE_html>
<!--[if_lt IE 7]> <html_class="ie6"> <![endif]-->
<!--[if IE 7]>  _ <html class="ie7"> <![endif]-->
<!--[if IE 8]>_   <html class="ie8"> <![endif]-->
<!--[if gt_IE 8]><!--> <html> <!--<![endif]-->
<head profile="http://gmpg.org/xfn/11">
 <meta_charset="UTF-8">
 <title>
   _ Erased_US data shows 1 in_4 missiles in_Afghan airstrikes_now fired by_drone: The Bureau of Investigative Journalism_ </title>

 <meta_name="description" content="Drone data has been wiped_from_the Air Force_website.">

_<meta_name="generator" content="Magicalia_2010" />
 <meta_name="google-site-verification"_content="bGFVI6kAZGjMNNiS6LGvBDWSGydwyWQI3gogCD4xP50" />

_<link_href="http://cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
 <link rel="stylesheet" href="http://www.thebureauinvestigates.com/wp-content/themes/dxw_magicalia/css/screen.css"_type="text/css"_media="screen, projection" />
 <link rel="stylesheet" href="http://www.thebureauinvestigates.com/wp-content/themes/dxw_magicalia/css/