Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#162797 - 26/05/2003 17:12 GPSapp python script: Invalid Literal for Float
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
I'm trying to get GPSapp working, and need to create a route file. This is a basic route from my house to best buy, about 15 minutes away. I've tried two other routes using compleetly different starting and ending points., and they all gave the same result. I'm not a python guy, so I have no idea what could be wrong... I've attached the route file, and this is what the script outputs:

[mkocher@ih-ws1 gpsapp-0.17]$ ./parse_mapsonus.py bestbuy.html
['START', '-122.24865', '37.86942', '{MARK.START}', 'Start', 'Point', '(2', 'Panoramic', 'Way,', 'Berkeley,', 'CA)']
['END', '-122.28859', '37.81677', '{MARK.END}', 'End', 'Point', '(Mandela', 'Pkwy,', 'oakland,', 'CA)']
['END', '--></center><br><br>', '<center>', '<table', 'width="90%"', 'cellpadding="0"', 'cellspacing="0"', 'border="0">', '<tbody><tr><td', 'colspan="2"><hr', 'width="90%"', 'align="center"></td>', '</tr>', '<tr><td>\xa0</td><td><br><div', 'class="s12"', 'align="center">', '<a', 'href="http://mapsonus.switchboard.com/">Home</a>', '|', '<a', 'href="http://mapsonus.switchboard.com/auxcgi/MenuFrameLR.cgi/usr=%7E3ed2a72b.5c826.6afd.6/c=6?Url=/doc/maps.aboutus.cgi&amp;Title=About+Us">About', 'Us</a>', '|', '<a', 'href="http://mapsonus.switchboard.com/auxcgi/MenuFrameLR.cgi/usr=%7E3ed2a72b.5c826.6afd.6/c=6?Url=/marketing/contactus.html&amp;Title=Contact+Us">Contact', 'Us</a>', '|', '<a', 'href="http://mapsonus.switchboard.com/doc/makemap.html">Link', 'To', 'Us</a>', '|', '<a', 'href="http://mapsonus.switchboard.com/auxcgi/MenuFrameLR.cgi/usr=%7E3ed2a72b.5c826.6afd.6/c=6?Url=/marketing/advertise.cgi&amp;Title=Advertising">Advertise</a>', '|', '<a', 'href="http://mapsonus.switchboard.com/auxcgi/MenuFrameLR.cgi/usr=%7E3ed2a72b.5c826.6afd.6/c=6?Url=/doc/maps.privacy.cgi&amp;Title=Privacy+Policy">Policies</a>\xa0\xa0\xa0</div><br>', '<div', 'class="s11"', 'align="left">', '</div></td>', '</tr>', '<tr><td', 'colspan="2"', 'align="center"><img', 'src="bestbuy_files/Space.gif"', 'width="630"', 'height="1"', 'border="0"></td></tr>', '<tr><td>\xa0</td>', '<td', 'align="center">', '<div', 'class="s12"', 'align="center">', '<font', 'size="-2"', 'face="arial,helvetica">', '<br>', '<a', 'href="http://www.databyacxiom.com/"><img', 'src="bestbuy_files/acxiom.gif"', 'alt="Data', 'by', 'Acxiom"', 'border="0"', 'width="82"', 'height="12"></a>', '<br><br>', '</font>', 'Map', 'data', 'copyright', 'Tele', 'Atlas', 'North', 'America,', 'Inc,', '1984-2003;', 'use', 'subject', 'to', '<a', 'href="http://mapsonus.switchboard.com/auxcgi/MenuFrameLR.cgi/usr=%7E3ed2a72b.5c826.6afd.6/c=6?Url=/doc/endUserLicense.html&amp;Title=License+Agreement"', 'target="_top">license\xa0agreement</a>.', '<br><br><a', 'href="http://mapsonus.switchboard.com/auxcgi/MenuFrameLR.cgi/usr=%7E3ed2a72b.5c826.6afd.6/c=6?Url=/doc/endUserLicense.html&amp;Title=License+Agreement"', 'target="_top">Copyright</a>', '\xa9', '1996-2003', '<a', 'href="http://www.switchboard.com/">Switchboard', 'Incorporated</a>.', 'All', 'Rights', 'Reserved.', '<br>Switchboard', 'is', 'a', 'registered', 'service', 'mark', 'of', '<a', 'href="http://www.switchboard.com/">Switchboard', 'Inc</a>.', '<br><br>', '</div>', '</td>', '</tr>', '</tbody></table>', '</center></td></tr>', '</tbody></table>', '</body></html>']
Traceback (most recent call last):
File "./parse_mapsonus.py", line 105, in ?
wpoints = parse(inname)
File "./parse_mapsonus.py", line 39, in parse
long = float(parts[1])
ValueError: invalid literal for float(): --></center><br><br>


Attachments
160880-bestbuy.html (396 downloads)


Top
#162798 - 26/05/2003 19:24 Re: GPSapp python script: Invalid Literal for Floa [Re: matthew_k]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Yeah, this is a bit of a weird one;

Go back to your basic route description, ie the page where you'd click on 'raw route description', not the raw route itself. Right-click on the raw route link and 'save link target as'.

Then parse that file. I have no idea why doing that seems to work but following the link and then saving the page doesn't.
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#162799 - 27/05/2003 00:33 Re: GPSapp python script: Invalid Literal for Floa [Re: genixia]
matthew_k
pooh-bah

Registered: 12/02/2002
Posts: 2298
Loc: Berkeley, California
Hmmm. I've tried mozilla, IE and wget, and they all give me the same thing. Is there something else I could be doing wrong?

Matthew

Top
#162800 - 27/05/2003 09:41 Re: GPSapp python script: Invalid Literal for Floa [Re: matthew_k]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
Now where did that banner at the end come from?

Just remove anything after the </xmp> and it should work, i.e.

<br><br><center>
<!--BEGIN http://www.mapsonus.com (468x60 (Full Banner))-->
<script language="JavaScript">
...
...
_________________________
40GB - serial #40104051 gpsapp

Top