Re: using urllib2

2008-06-29 Thread Jeff McNeil
I didn't spend a lot of time debugging that code -- I've been using beautiful soup a lot at work lately and really pulled that out of memory at about 2:00 AM a couple days ago. In the 5 minute I spent on it, it appeared that the definitions were setup like so: Blah Definition> I was attempti

Re: using urllib2

2008-06-29 Thread Alexnb
Okay, now I ran in it the shell, and this is what happened: >>> for tabs in soup.findAll('table', {'class': 'luna-Ent'}): ... tabs.findAll('td')[-1].contents[-1].string ... u' ' u' ' u' ' u' ' u' ' u'not complex or compound; single. ' u' ' u' ' u' ' u' ' u' ' u'inconsequential or rudimentary

Re: using urllib2

2008-06-29 Thread Alexnb
Actually after looking at this, the code is preactically the same, except the definitions. So what COULD be going wrong here? Alexnb wrote: > > Okay, so i've hit a new snag and can't seem to figure out what is wrong. > What is happening is the first 4 definitions of the word "simple" don't > sho

Re: using urllib2

2008-06-29 Thread Alexnb
Okay, so i've hit a new snag and can't seem to figure out what is wrong. What is happening is the first 4 definitions of the word "simple" don't show up. The html is basicly the same, with the exception of noun turning into adj. Ill paste the html of the word cheese, and then the one for simple, a

Re: using urllib2

2008-06-29 Thread Jeff McNeil
On Jun 29, 12:50 pm, Alexnb <[EMAIL PROTECTED]> wrote: > No I figured it out. I guess I never knew that you aren't supposed to split a > url like "http://www.goo\ > gle.com" But I did and it gave me all those errors. Anyway, I had a > question. On the original code you had this for loop: > > for ta

Re: using urllib2

2008-06-29 Thread Alexnb
No I figured it out. I guess I never knew that you aren't supposed to split a url like "http://www.goo\ gle.com" But I did and it gave me all those errors. Anyway, I had a question. On the original code you had this for loop: for tabs in soup.findAll('table', {'class': 'luna-Ent'}): yield

Re: using urllib2

2008-06-27 Thread Alexnb
Okay, so I copied your code(and just so you know I am on a mac right now and i am using pydev in eclipse), and I got these errors, any idea what is up? Traceback (most recent call last): File "/Users/Alex/Documents/workspace/beautifulSoup/src/firstExample.py", line 14, in print list(get_de

Re: using urllib2

2008-06-27 Thread Alexnb
I have read that multiple times. It is hard to understand but it did help a little. But I found a bit of a work-around for now which is not what I ultimately want. However, even when I can get to the page I want lets say, "Http://dictionary.reference.com/browse/cheese", I look on firebug, and exte

Re: using urllib2

2008-06-27 Thread Alexnb
I have read that multiple times. It is hard to understand but it did help a little. But I found a bit of a work-around for now which is not what I ultimately want. However, even when I can get to the page I want lets say, "Http://dictionary.reference.com/browse/cheese", I look on firebug, and exte

Re: using urllib2

2008-06-27 Thread Jeff McNeil
I stumbled across this a while back: http://www.voidspace.org.uk/python/articles/urllib2.shtml. It covers quite a bit. The urllib2 module is pretty straightforward once you've used it a few times. Some of the class naming and whatnot takes a bit of getting used to (I found that to be the most con

Re: using urllib2

2008-06-27 Thread Alexnb
Okay, I tried to follow that, and it is kinda hard. But since you obviously know what you are doing, where did you learn this? Or where can I learn this? Maric Michaud wrote: > > Le Friday 27 June 2008 10:43:06 Alexnb, vous avez écrit : >> I have never used the urllib or the urllib2. I really h

Re: using urllib2

2008-06-27 Thread Maric Michaud
Le Friday 27 June 2008 10:43:06 Alexnb, vous avez écrit : > I have never used the urllib or the urllib2. I really have looked online > for help on this issue, and mailing lists, but I can't figure out my > problem because people haven't been helping me, which is why I am here! :]. > Okay, so basica