diff --git a/orbit/tle.py b/orbit/tle.py index ff93666..00be0bb 100644 --- a/orbit/tle.py +++ b/orbit/tle.py @@ -10,11 +10,11 @@ requests_cache.install_cache(expire_after=86400) def get(catnr): - page = html.fromstring(requests.get('http://www.celestrak.com/cgi-bin/TLE.pl?CATNR=%s' % catnr).text) - tle = page.xpath('//pre/text()')[0].split('\n') - return tle[1].strip(), tle[2].strip(), tle[3].strip() + page = html.fromstring(requests.get('http://www.celestrak.com/NORAD/elements/gp.php?CATNR=%s' % catnr).text) + tle = page.xpath('//p/text()')[0].split('\n') + return tle[0].strip(), tle[1].strip(), tle[2].strip() def parse(name, line1, line2): tle_rec = ephem.readtle(name, line1, line2) tle_rec.compute() - return tle_rec \ No newline at end of file + return tle_rec