bfishadow / sbb Goto Github PK
View Code? Open in Web Editor NEWA Python script to download all articles from any Sina Blog blogger.
A Python script to download all articles from any Sina Blog blogger.
so I can convert it with kindlegen
抓取图片到本地的功能不知道实现了没?
F:\git\SBB>SBB.py http://blog.sina.com.cn/u/1239657051
File "F:\git\SBB\fengzongtangzhu\SBB.py", line 26
print strUsage
^
SyntaxError: invalid syntax
What should I do to fix it?
作者大神~~
您好。我刚试用您的SBB,在win10, 64位电脑,Python 2.7.8下,但出现报错。请求您的帮助。多谢!
报错信息如下:
E:\SOFTWARE\SBB-master>SBB.py http://blog.sina.com.cn/surebb
1415368884
Traceback (most recent call last):
File "E:\SOFTWARE\SBB-master\SBB.py", line 175, in
objFileArticle = open(strLocalFilename, "w")
IOError: [Errno 22] invalid mode ('w') or filename: 'Post_1_545cd0b40100038z_\xe5\x86\x99\xe7\x82\xb9\xe5\x84\xbf\xe4\xbb\x80\xe4\xb9\x88\xe5\x91\xa2\xef\xbc\x9f2006.4.16.html'
在Python 3.5.2下运行报错:
D:\SBB-master>python SBB.py http://blog.sina.com.cn/1ness
File "SBB.py", line 26
print strUsage
^
SyntaxError: Missing parentheses in call to 'print'
While dumping the articles, the script sometimes terminated while executing below codes (Line 101):
objResponse = urllib2.urlopen(strTargetBlogPostURL)
strPageCode = objResponse.read()
objResponse.close()
This is very boring since there's no persistent of artical list. Once the script crashe, we had to retrieve those articals once again. Very time consuming. This issue can be fixed by adding execption handling for it:
try: <--
objResponse = urllib2.urlopen(strTargetBlogPostURL)
strPageCode = objResponse.read()
objResponse.close()
except: <--
print " failed to get ", intCounter , ": ", strTargetBlogPostURL
pass
谢谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.