File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 10
10
db = clients ["XiMaLaYa" ]
11
11
col1 = db ["album2" ]
12
12
col2 = db ["detaile2" ]
13
- # cookies = {
14
- # 'Cookie': '_xmLog=xm_1497536646561_j3yinjq9yfbobs; trackType=web; x_xmly_traffic=utm_source%3A%26utm_medium%3A%26utm_campaign%3A%26utm_content%3A%26utm_term%3A%26utm_from%3A; _ga=GA1.2.1494610706.1497536647',
15
- # }
16
- # start_url = 'http://www.ximalaya.com/dq/all/'
13
+
17
14
UA_LIST = [
18
15
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/22.0.1207.1 Safari/537.1" ,
19
16
"Mozilla/5.0 (X11; CrOS i686 2268.111.0) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11" ,
72
69
}
73
70
74
71
75
- # content = {}
76
-
77
-
78
72
def get_url ():
79
73
start_urls = ['http://www.ximalaya.com/dq/all/{}' .format (num ) for num in range (1 , 85 )]
80
74
for start_url in start_urls :
@@ -116,7 +110,7 @@ def get_m4a(url):
116
110
dic = json .loads (html )
117
111
col2 .insert (dic )
118
112
print (murl + '中的数据已被成功插入mongodb' )
119
- # print(dic)
113
+
120
114
121
115
if __name__ == '__main__' :
122
- get_url ()
116
+ get_url ()
You can’t perform that action at this time.
0 commit comments