Results 1 to 3 of 3

Thread: Python?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jul:2001
    Location:
    Posts: 10,937

    Python?


    html ( cr/lf)
    Code:
    <html><head>Heading</head><body attr1=''val1''>    <div class=''container''>    </div> <div class=''node_detail''>             <span class=''node_desc''>Part 1</span><br>             1.2        </div>  <div class=''node_detail''>             <span  class=''node_desc''>Part 2</span><br>              2.99        </div></body></html>

    HTML Code:
    <head>Heading</head>
    <body attr1=''val1''>    
    <div class=''container''>    </div> 
    <div class=''node_detail''>             
                 <span class=''node_desc''>Part 1</span><br>             1.2        </div>  
    <div class=''node_detail''>
                 <span  class=''node_desc''>Part 2</span><br>              2.99        </div>
    </body>
    10- <div class=''node_detail''> , node_desc

    1.2 / 2.99 / .... -


    Code:
    from bs4 import BeautifulSoup
    
    html = ' HTML '
    
    parsed = BeautifulSoup(html)
    
    result = parsed.body.find('div', attrs={'class':'node_detail'}).text
    print result
    
    Part 1             1.2
    ...
    node_detail?

    ... Part1
    5 , :S

  2. #2
    Registered User
    Join Date: Jul:2001
    Location:
    Posts: 10,937
    , .

  3. #3
    Banned
    Join Date: Mar:2008
    Location: ᠌᠌᠌᠌
    Posts: 992
    "",

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |