Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

beuatiful soup find a href

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']
Comment

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']
Comment

PREVIOUS NEXT
Code Example
Python :: installing django 
Python :: Python function remove all whitespace from all character columns in dataframe 
Python :: # fontawesome install django for free 
Python :: numpy find rows containing nan 
Python :: python make txt file 
Python :: django create empty migration 
Python :: absolute value columns pandas 
Python :: pandas convert all column names to lowercase 
Python :: python schedule timezone 
Python :: matplotlib get rid of gridlines 
Python :: numpy install 
Python :: rmse in python 
Python :: put comma in numbers python 
Python :: how to check for a particular word in a text file using python 
Python :: 2 list difference python 
Python :: split string every n characters python 
Python :: python file size 
Python :: Convert a Video in python to individual Frames 
Python :: Python - How to check if string is a HEX Color Code 
Python :: stopwatch in python 
Python :: plot specific columns pandas 
Python :: flask run app reset on change 
Python :: delete unnamed 0 columns 
Python :: how to split a string between letters and digits python 
Python :: get max float value python 
Python :: infinity in python 
Python :: python get ip from hostname 
Python :: pandas left join 
Python :: timedelta year python 
Python :: how to update pandas 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =