Skip to content

Instantly share code, notes, and snippets.

@kmcallister
Created August 9, 2012 18:03
Show Gist options
  • Save kmcallister/3306591 to your computer and use it in GitHub Desktop.
Save kmcallister/3306591 to your computer and use it in GitHub Desktop.
print all link hrefs
import sys
from BeautifulSoup import BeautifulSoup
for a in BeautifulSoup(sys.stdin).findAll('a'):
print a['href']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment