[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Python og HTML ..



Hej,

Jeg sider og bliver mere og mere frusteret over en relativ simpel ting ..

Jeg har et html dokument, som jeg parser med htmllib/urllib ..

Jeg forsøger og finde en href som er inde i et a tag..

<a onmouseout="this.style.backgroundPosition='top'" onmouseover="this.style.backgroundPosition='bottom'" style="display: block; position: absolute; top: 105.667px; left: 360px; z-index: 1; width: 144px; height: 48px; background: url(&quot;SomeOtherUrl&quot;) repeat scroll center top rgb(34, 34, 34);" href="THISURL"></a>

Men jeg løber panden imod muren hele tiden når jeg skal finde "ThisUrl"

Mit seneste forsøg var noget ala

p = htmllib.HTMLParser(formatter.NullFormatter())
    p.feed(urllib.urlopen(link).read())
    p.close()
    for url in p.anchorlist: print url

Hvilke giver mig en pæn liste over links - men lige den der finder den ikke..

Er der nogen kloge hover som kan hjælpe mig lidt på vejen?

(Sidebemærkning - Jeg har ikke fanget OO i python endnu, da jeg stadig er newbie - så hold lidt igen med classer osv..)..

/~ Henrik


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2011-04-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *