GPSapp python script: Invalid Literal for Float

Posted by: matthew_k

GPSapp python script: Invalid Literal for Float - 26/05/2003 17:12

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>
Posted by: genixia

Re: GPSapp python script: Invalid Literal for Floa - 26/05/2003 19:24

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.
Posted by: matthew_k

Re: GPSapp python script: Invalid Literal for Floa - 27/05/2003 00:33

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
Posted by: jaharkes

Re: GPSapp python script: Invalid Literal for Floa - 27/05/2003 09:41

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">
...
...