< new robotfindskitten!
429 Too Many Requests >

[No comments] For Aaron:

import urllib2
from bs4 import BeautifulSoup

url = 'http://www.poemhunter.com/best-poems/william-stafford/thinking-for-berky/'
soup = BeautifulSoup(urllib2.urlopen(url))

print soup.find(attrs="title").text
for s in soup.find(attrs="poem").strings:
    print s.strip()
Filed under: ,


Post a comment

Your name:

Your home page:

Remember this information

Comments:

Allowed HTML tags: <a>, <b>, <i>. Blank lines become paragraph separators.


[Main] [Edit]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.