-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from Lab-317/feature/013-stormmedia
add Stormmedia Parser
- Loading branch information
Showing
4 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
# @Author: DinoLai | ||
# @Date: 2014-11-08 23:06:56 | ||
# @Last Modified by: DinoLai | ||
# @Last Modified time: 2014-11-09 01:54:31 | ||
|
||
from AbstractNewsParseStrategy import AbstractNewsParseStrategy | ||
|
||
|
||
class StormMediaGroupParseStrategy(AbstractNewsParseStrategy): | ||
|
||
def isURLMatch(self, url): | ||
return ".stormmediagroup.com" in url | ||
|
||
def getTitle(self, beautiful_soup_object): | ||
return beautiful_soup_object.select('.innerBigNewsTitle')[0].text | ||
|
||
def getAuthor(self, beautiful_soup_object): | ||
return beautiful_soup_object.select('.innerNewsInfo > a')[0].text | ||
|
||
def getContent(self, beautiful_soup_object): | ||
#beautiful_soup_object.select('.newsDescBlk')[0].style.decompose() | ||
return beautiful_soup_object.select('.newsDescBlk')[0].text | ||
|
||
def getPublishDate(self, beautiful_soup_object): | ||
return beautiful_soup_object.select('.innerNewsInfo')[0].text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters