How get line from web site with Python
Question: I want to print only line containing --> REQUIRES="berusky-data"

I try this but not work :

    
    
    import urllib2
    import re
    
    f = urllib2.urlopen('http://slackbuilds.org/slackbuilds/14.1/games/berusk/berusky.info')
    r = f.read()
    
    
    for line in r:
        if "REQUIRES" in r:
              print line,
    


Answer: Use
[`splitlines()`](https://docs.python.org/2/library/stdtypes.html#str.splitlines)
for splitting the data by new-lines and check if `REQUIRES` string is in
`line`:

    
    
    for line in r.splitlines():
        if "REQUIRES" in line:
              print line,
    

Demo:

    
    
    >>> import urllib2
    >>> f = urllib2.urlopen('http://slackbuilds.org/slackbuilds/14.1/games/berusky/berusky.info')
    >>> r = f.read()
    >>> for line in r.splitlines():
    ...     if "REQUIRES" in line:
    ...         print line,
    ... 
    REQUIRES="berusky-data"
    

