sample code for parsing html file to get contents of td fields
does anyone have sample code for parsting an html file to get contents of a td field to write to a mysql db? even if you have everything but the mysql db part ill take it. thanks yaffa -- http://mail.python.org/mailman/listinfo/python-list
sample script to write results of html scrape to mysql db?
does anyone have a sample script that writes results of html scraping to a mysql db? -- http://mail.python.org/mailman/listinfo/python-list
sqlobject vs mysqldb module
dear group, i have a python script that scrapes contents from an html file and i would like to have the script write values to a mysql db. do you recommend i go with the sqlobject or the mysqldb module? thank you yaffa -- http://mail.python.org/mailman/listinfo/python-list
need help with python syntax
dear python gurus,
quick question on syntax.
i have a line of code like this
for incident in bs('tr', {'bgcolor' : '#ee'}):
what i want it to do is look for 'bgcolor' : '#ee' or 'bgcolor' :
'white' and then do a whole bunch of stuff.
i've tried this:
for incident in bs('tr', {'bgcolor' : '#ee'} or {'bgcolor' :
'white'} ): but it only seems to pick up the stuff from the
{'bgcolor' : '#ee'}
any ideas folks?
thanks
yaffa
--
http://mail.python.org/mailman/listinfo/python-list
Python interpreter error: unsupported operand type(s) for |:
hey folks i get this error: Python interpreter error: unsupported operand
type(s) for |:
when i run this line of code:
for incident in bs('tr', {'bgcolor' : '#ee'} | {'bgcolor' :
'white'} ):
any idea what i'm doing wrong here?
thanks
yaffa
--
http://mail.python.org/mailman/listinfo/python-list
need help with my append syntax
dear folks,
i'm trying to append a semicolon to my addr string and am using the
syntax below. for some reason the added on of the ; doesn't work.
when i print it out later on it only shows the original value of addr.
addr = incident.findNextSibling('td')
addr.append('%s;')
thanks
yaffa
--
http://mail.python.org/mailman/listinfo/python-list
how to append semicolon to a variable
dear folks,
i have the following lines of python code:
couch = incident.findNextSibling('td')
price = couch.findNextSibling('td')
sdate = price.findNextSibling('td')
city = sdate.findNextSibling('td')
strUrl = addr.b.string
currently what this ends up doing is creating something like this
couch3201/01/2004newyork
now what i want to do is add a semicolon after the couch, price, sdate,
city so that i get something like this
couch;32;01/01/2004;new york
does anyone know how to do this?
thanks
yaffa
p.s. i tried couch = couch + ';' and then i tried couch = couch + ";"
and then i tried couch = couch.append ';'
--
http://mail.python.org/mailman/listinfo/python-list
