Search Results

Search found 5 results on 1 pages for 'barnabe'.

Page 1/1 | 1 

  • Extracting an attribute value with beautifulsoup

    - by Barnabe
    I am trying to extract the content of a single "value" attribute in a specific "input" tag on a webpage. I use the following code: import urllib f = urllib.urlopen("http://58.68.130.147") s = f.read() f.close() from BeautifulSoup import BeautifulStoneSoup soup = BeautifulStoneSoup(s) inputTag = soup.findAll(attrs={"name" : "stainfo"}) output = inputTag['value'] print str(output) I get a TypeError: list indices must be integers, not str even though from the Beautifulsoup documentation i understand that strings should not be a problem here... but i a no specialist and i may have misunderstood. Any suggestion is greatly appreciated! Thanks in advance.

    Read the article

  • openlayers, SVG and flash app

    - by Barnabe
    I would like to display a SVG layer (polygons) over the openlayers tiles in an html page, or alternatively, load my SVG in flash and have the OL tiles rendered into flash as well. Is any/either of these ideas possible at all? Thanks in advance

    Read the article

  • Creating SVG map from geometry stored in MySQL

    - by Barnabe
    I have a group of geometries stored in MySQl (as polygon and as well-known text) representing counties. I can build a table of geometries and color codes after querying some county data (say GDP per capita). What is the best way to export this as an SVG map? I cannot find any reference to SVG conversion in the MySQL documentation.

    Read the article

  • Error when feeding a mysql db with a python-parsed data

    - by Barnabe
    I use this bit of code to feed some data i have parsed from a web page to a mysql database c=db.cursor() c.executemany( """INSERT INTO data (SID, Time, Value1, Level1, Value2, Level2, Value3, Level3, Value4, Level4, Value5, Level5, ObsDate) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", clean_data ) The parsed data looks like this (there are several hundred such lines) clean_data = [(161,00:00:00,8.19,1,4.46,4,7.87,4,6.54,null,4.45,6,2010-04-12),(162,00:00:00,7.55,1,9.52,1,1.90,1,4.76,null,0.14,1,2010-04-12),(164,00:00:00,8.01,1,8.09,1,0,null,8.49,null,0.20,2,2010-04-12),(166,00:00:00,8.30,1,4.77,4,10.99,5,9.11,null,0.36,2,2010-04-12)] if i hard code the data as above mySQL accepts my request (except for some quibbles about formatting) but if the variable clean_data is instead defined as the result of the parsing code, like this: cleaner = [(""" $!!'""", ')]'),(' $!!', ') etc etc] def processThis(str,lst): for find, replace in lst: str = str.replace(find, replace) return str clean_data = processThis(data,cleaner) then i get the dreaded "TypeError: not enough arguments for format string" After playing with formatting options for a few hours (I am very new to this) I am confused... what is the difference between the hard coded data and the result of the processThis function as fas as mySQL is concerned? Any idea greatly appreciated...

    Read the article

  • Display ALL categories that a product belongs to in Magento

    - by Jason
    I am conceptualizing a new Magento site which will have products that are included in several categories. What I am wondering is if I can display all categories a product is in on the product detail page. I know that it is possible to get the category, but is it possible to display a list of all categories which a product belongs to? For example, a shirt may be included in the Shirts category, as well as in Designers and Summer. Ideally, I would like to be able to display the following: More from:    Men Shirts    Men Designers Barnabé Hardy    Men Summer

    Read the article

1