nope didn't work
--
http://mail.python.org/mailman/listinfo/python-list
tried that, didn't work for me
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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')
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
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
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
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',
15 matches
Mail list logo