File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 1- #The file downloads songs all audio songs from "http://www.linkersweddingsolutions.com/weddingsongs/list-of-wedding-songs-from-hindi-movies.html":
2- #Work in progress
31from bs4 import BeautifulSoup
42
53import urllib2
6-
74response = urllib2 .urlopen ('http://www.linkersweddingsolutions.com/weddingsongs/list-of-wedding-songs-from-hindi-movies.html' )
85html = response .read ()
96links = []
7+ rows = []
108
119soup = BeautifulSoup (html )
10+
11+ table = soup .find ('table' , {'class' : 'download' })
12+
13+ for row in table .findAll ('tr' ):
14+ matter = row .findAll ('td' )
15+ print 'matter is' , matter .prettify ()
16+
17+ """
18+ rows.append(matter[0].contents)
19+ links.append(matter[3])
20+
21+ key = str(row[::1])
22+ links[key] = row[::3]
1223soup = soup.select('a[href^="http://www.mymp3singer.com/get.php?"]')
1324for link in soup:
1425 links.append(str(link['href']))
1526
16- # work here
1727response = urllib2.urlopen(links[0])
1828html = response.read()
1929
2030print 'response is', response.info()
2131file_size_dl = 0
22- bufferSize = 8192
32+
33+
2334f = open('testFile.mp3', 'wb')
2435while True:
25- buffer = response .read (bufferSize )
36+ buffer = response.read(8192 )
2637 if not buffer:
2738 break
2839
2940 file_size_dl += len(buffer)
3041 f.write(buffer)
3142f.close()
43+ """
You can’t perform that action at this time.
0 commit comments