这些之间有什么区别
Webdriver.Close()
Webdriver.Quit()
Webdriver.Dispose()
哪一个和什么时候使用?
我正在调试 python 代码(python2.7.12),因为我的代码可以工作,但是当我将推文流式传输到数据库时,所有变量都为 NULL。
我得到的错误是:
Exception AttributeError: "'NoneType' object has no attribute 'path'" in <function _remove at 0x10068f140> ignored
Run Code Online (Sandbox Code Playgroud)
我假设这个错误来自下面的代码:
def put_tweets_in_database(tweets):
print "putting tweets in database"
errors = 0
count = 0
for tweet in tweets:
try:
commit_tweet_to_database(tweet, count, len(tweets))
count += 1
except Exception as e:
print e
session.rollback()
errors += 1
print 'there were {} errors'.format(errors)
Run Code Online (Sandbox Code Playgroud)
我不认为这个功能commit_tweet_to_database()
有问题...
你有什么主意吗...?我将不胜感激任何帮助!
谢谢。