Skip to content

Commit

Permalink
add a solution
Browse files Browse the repository at this point in the history
  • Loading branch information
howel52 committed Jun 18, 2016
1 parent dac77e8 commit 9a657d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lenzzz/0004/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
else:
words[word] = 1



for key in words:
if key == " ":
continue
Expand Down
16 changes: 16 additions & 0 deletions lenzzz/0013/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# python3
#coding:utf-8
import requests
from bs4 import BeautifulSoup

def downloadPic(url):
req = requests.get(url)
imageName = url.split('/')[-1]
with open(imageName, 'wb') as fp:
fp.write(req.content)

html = requests.get("http://tieba.baidu.com/p/2166231880").content
soup = BeautifulSoup(html, "html.parser")
for img in soup.find_all("img", {"class", "BDE_Image"}):
downloadPic(img['src'])

0 comments on commit 9a657d9

Please sign in to comment.