本文整理汇总了Python中article.Article.parseArticle方法的典型用法代码示例。如果您正苦于以下问题:Python Article.parseArticle方法的具体用法?Python Article.parseArticle怎么用?Python Article.parseArticle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类article.Article
的用法示例。
在下文中一共展示了Article.parseArticle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parseArticle
# 需要导入模块: from article import Article [as 别名]
# 或者: from article.Article import parseArticle [as 别名]
def parseArticle(args):
if len(args) != 1:
print 'No article given. Please specify a link to an article to parse.'
return
article = Article(url=args[0])
print 'Working with: %s' % article.url
print 'Attempting to download the article.'
couldDownload = article.downloadArticle()
if not couldDownload:
print 'Could not download the article. Is the URL correct? Is their site up? Is GTWifi working for you right now?'
return
print 'Successfully downloaded the article.'
article.parseArticle()
print 'Article body:'
print article.content