Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

grab a href using beuatiful soup

from BeautifulSoup import BeautifulSoup

html = '''<a href="some_url">next</a>
<span class="class"><a href="another_url">later</a></span>'''

soup = BeautifulSoup(html)

for a in soup.find_all('a', href=True):
    print "Found the URL:", a['href']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #grab #href #beuatiful #soup
ADD COMMENT
Topic
Name
4+1 =