Re: how to remove using replace function?

2006-02-08 Thread localpricemaps
nope didn't work -- http://mail.python.org/mailman/listinfo/python-list

Re: how to remove using replace function?

2006-02-08 Thread localpricemaps
tried that, didn't work for me -- http://mail.python.org/mailman/listinfo/python-list

how to remove using replace function?

2006-02-08 Thread localpricemaps
i have some html that looks like this 34 main, Boston, MA and i am trying to use the replace function to get rid of the that i scrape out using this code: for oText in incident.fetchText( oRE): strTitle += oText.strip() strTitle = string.replace(strTitle,'','') but it

Re: problems writing tuple to log file

2006-02-03 Thread localpricemaps
the, the issue is that the last loop adds the last value of everything to the data array -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation messing up my tuple?

2006-02-03 Thread localpricemaps
the, the issue is that the last loop adds the last value of everything to the data array -- http://mail.python.org/mailman/listinfo/python-list

problems writing tuple to log file

2006-02-03 Thread localpricemaps
i am having a problem writing a tuple to a text file. my code is below. what i end up getting is a text file that looks like this burger, 7up burger, 7up burger, 7up and this is instead of getting a list that should look like this burger, 7up fries ,coke cake ,milk note that i have print stat

Re: indentation messing up my tuple?

2006-02-01 Thread localpricemaps
i am using a tuple because i am building lists. if i just use (food + drink) then while drink is unique food remains the same do i get this: (burger, coke) (burger, 7up) (burger, sprite) infidel wrote: > tuple is the name of the built-in type, so it's not a very good idea to > reassign it to som

Re: indentation messing up my tuple?

2006-01-28 Thread localpricemaps
sorry i left out my tuple which is at the end of my code tuple = (food + drink + "\n") data.append(tuple) f = open("froogle.sql", 'a') f.write ( ''.join( tuple ) -- http://mail.python.org/mailman/listinfo/python-list

Re: indentation messing up my tuple?

2006-01-28 Thread localpricemaps
sorry i forgot to add in the code for my tuple which is at the very end tuple = (food+ drink + "\n") data.append(tuple) f = open("froogle.sql", 'a') f.write ( ''.join( tuple ) -- http://mail.python.org/mailman/listinfo/python-list

indentation messing up my tuple?

2006-01-27 Thread localpricemaps
i have the following code which is used to create a tuple of food and drink. if the page i am trying to scrape has a total of 10 food/drink items that i end up getting a nice list of 10 food/drink items in my text file BUT they are all a repeat of the first item so i end up getting a text file tha

am i using findNextSibling wrong?

2006-01-24 Thread localpricemaps
i have this html: 3.99 1.05 3 http://www.cnn.com"; target="_blank" onclick="reload()"> i tried to this use this python to scrape out the href cnn.com and failed. for incident in row('td', {'class':'price'}): n = incident.findNextSibling('a')

Re: how to find not the next sibling but the 2nd sibling or findsibling "a" OR sinbling "b"

2006-01-23 Thread localpricemaps
well actually all i want it to do is find the first thing that shows up whether its class:food or class: drink so that works for me. only thing is that after it finds class:food i think it runs through the html again and finds the following class:drink and being that there is not class tag after t

Re: how to find not the next sibling but the 2nd sibling or findsibling "a" OR sinbling "b"

2006-01-19 Thread localpricemaps
hey fredrik, i don't understand what you are saying Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > ok i found something that works. instead of using the def i did this: > > > > for incident in row('div', {'class': 'food' or 'drink' }): > > > > and it worked! > > 'food' or 'drink' doesn't

Re: how to find not the next sibling but the 2nd sibling or find sibling "a" OR sinbling "b"

2006-01-19 Thread localpricemaps
i actually realized there are 3 potentials for class names. either food or drink or dessert. so my question is whether or not i can alter your function to look like this? def isFoodOrDrinkOrDesert(attr): return attr in ['food', 'drink', 'desert'] thanks in advance for the help Kent Johns

how to find not the next sibling but the 2nd sibling or find sibling "a" OR sinbling "b"

2006-01-18 Thread localpricemaps
i have some html which looks like this where i want to scrape out the href stuff (the www.cnn.com part) Cheese Blue http://www.cnn.com";> so i wrote this code which scrapes it perfectly: for incident in row('div', {'class':'noFood'}): b = incident.findNextSibling('div',