extract url from page python

Solutions on MaxInterview for extract url from page python by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "extract url from page python"
Augustina
11 May 2016
1from bs4 import BeautifulSoup
2
3your_html = '<div class="itemContainer"> <a c="" href="/mp3s/mp3/Shadmehr-Aghili-Avaz-Nemishi"><div class="image_crop"><img alt="2f370b436731d9b" src="'
4
5
6sp = BeautifulSoup(your_html)
7sp.find('a').get('href')
8
9# output:
10
11# /mp3s/mp3/Shadmehr-Aghili-Avaz-Nemishi