Created
August 10, 2014 13:57
-
-
Save vrootic/8afe5138594f5bdff27a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import datetime | |
| import time | |
| from BeautifulSoup import BeautifulSoup | |
| import requests | |
| def get_content(url): | |
| res = requests.get(url) | |
| return res.content | |
| def html_parser(): | |
| pass | |
| if __name__ == '__main__': | |
| d = datetime.datetime.now() | |
| start_time = time.mktime(datetime.datetime(d.year, d.month, d.day).timetuple()) | |
| start_time = str(int(start_time) * 1000) | |
| d = d + datetime.timedelta(days=1) | |
| end_time = time.mktime(datetime.datetime(d.year, d.month, d.day).timetuple()) | |
| end_time = str(int(end_time) * 1000) | |
| #print start_time, end_time | |
| result = get_content('http://weather.tp.edu.tw/Ajax/jsonp/table.ashx?callback=schooltable&id=333609&by=minute&start=1407600000000&end=1407686400000') | |
| print result |
dannvix
commented
Aug 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment