extract url from page python

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

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