Results 1 to 6 of 6

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Dec:2012
    Location: ,
    Posts: 24

    source code-

    . .
    http://www.dnes.bg/tv.php

    . source code- ?
    - :
    19.04 -


    20:00 -
    21:00 -


    19:00 - H

    ..

    , copy-paste 1 . ?

    .
    Last edited by vaslence; 19th April 2014 at 18:59.

  2. #2
    Nuclear's Avatar
    Join Date: Sep:2004
    Location: , . ()
    Posts: 3,352
    T source-, html parser, html :

    python Beautiful Soup :

    Code:
    #!/usr/bin/python
    from bs4 import BeautifulSoup
    import sys
    
    f = open(sys.argv[1],"r")
    html = f.read()
    
    parsed_html = BeautifulSoup(html)
    tbl=parsed_html.find_all('table')[1]
    
    for sp in tbl.find_all(True):
            if sp.name=="span":
                    print ""
                    print "<<<<< "+sp.text+" >>>>>>"
            if sp.name=="div":
                    if sp.has_key('class'):
                            if  sp["class"][0]== "info" or sp["class"][0]=="ttl":
                                    print sp.text
    :
    <<<<< 1 >>>>>>
    :

    19:45
    , !
    20:00

    20:30


    <<<<< bTV >>>>>>
    :
    bTV -
    19:30
    bTV -
    20:00
    " " -
    22:00
    " 3" - ,, , 1995 ., :

    <<<<< Nova TV >>>>>>
    :
    -
    19:30

    20:00
    " " - . , , ,...
    22:10
    " " -
    -human friendly , , ( , )
    , . , table span- div- class info ttl.
    . HWBG !

  3. #3
    Registered User
    Join Date: Dec:2012
    Location: ,
    Posts: 24
    , . ( " "), .
    Python Beautiful Soup, , ?
    , ?
    , ?
    .

    EDIT: Python, source code- , ?
    Last edited by vaslence; 19th April 2014 at 22:08.

  4. #4
    Registered User hateras's Avatar
    Join Date: Jan:2011
    Location: Kronos III
    Posts: 1,028
    , .
    " " - , .
    , .
    ASRock B550M Pro 4; Ryzen R5 3600; 2x16 GiB G.SKILL Aegis 3200; 1TB Samsung QVO 960 + 3TB Seagate IronWolf; Zalman Z1

  5. #5
    Registered User
    Join Date: Dec:2012
    Location: ,
    Posts: 24
    , ?

  6. #6

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 |