Skip to content

Commit

Permalink
Update DouBanSpider.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lanbing510 committed May 20, 2015
1 parent b4b3a83 commit 134a07a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DouBanSpider.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def book_spider(book_tag):
url="http://www.douban.com/tag/"+urllib.quote(book_tag)+"/book?start="+str(page_num*15)
time.sleep(np.random.rand()*2)

#Last Version, 伪装成浏览器
#Last Version
try:
req = urllib2.Request(url, headers=hds[page_num%len(hds)])
source_code = urllib2.urlopen(req).read()
Expand Down

0 comments on commit 134a07a

Please sign in to comment.