Skip to content

Instantly share code, notes, and snippets.

@mushfiq
Last active December 19, 2015 10:28
Show Gist options
  • Save mushfiq/5940183 to your computer and use it in GitHub Desktop.
Save mushfiq/5940183 to your computer and use it in GitHub Desktop.
Vote update
BeautifulSoup==3.2.0
requests==0.9.1
import time
import requests
from BeautifulSoup import BeautifulSoup
TIME_DELAY = 3
NEWS_URL = 'http://banglanews24.com/detailsnews.php?nssl=a660f4b238d34c8709c63915a9aaedfc&nttl=06072013208775'
news_results = []
def action(count):
resp = requests.get(NEWS_URL)
soup = BeautifulSoup(resp.content)
result = soup.find('h1')
if (count!=1) and (result.text not in news_results):
news_results.append(result.text)
return result.text
elif(count==1):
news_results.append(result.text)
return result.text
return
if __name__=='__main__':
i = 1
while(i):
news = action(i)
if news!=None:
print news
i+=1
time.sleep(TIME_DELAY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment