Giter Club home page Giter Club logo

sbb's People

Contributors

bfishadow avatar bryant1410 avatar heloman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbb's Issues

Can't run the script

After installing python, I tried to run the script. It returned by following info:

File "C:\Users\CarolWu\Private\SBB.py", line 7

^
SyntaxError: invalid syntax

What should I do to fix it?

在175行报错

您好。我刚试用您的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'

Exception handling required for urllib2

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.