We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cffdb4 commit 92d0916Copy full SHA for 92d0916
1 file changed
agmcs/0013/0013.py
@@ -0,0 +1,24 @@
1
+#coding:utf-8
2
+import requests, re, os
3
+
4
+url = 'http://tieba.baidu.com/p/2166231880'
5
6
+header = {
7
+ 'Accept': '*/*',
8
+ 'Accept-Encoding':'gzip,deflate,sdch',
9
+ 'Accept-Language':'zh-CN,zh;q=0.8',
10
+ 'Connection':'keep-alive'
11
+ }
12
+html = requests.get(url,headers = header)
13
14
+data = html.content.decode('utf-8')
15
+find = re.compile(r'<img pic_type="0" class="BDE_Image" src="(.*?).jpg" bdwater')
16
+result = find.findall(data)
17
18
+for img_url in result:
19
+ name = img_url.split('/')[-1]
20
+ img_url = img_url+'.jpg'
21
+ html = requests.get(img_url,headers = header)
22
+ im = html.content
23
+ with open(name+'.jpg','wb')as f:
24
+ f.write(im)
0 commit comments