Re: [Tutor] beautifulsoup

2016-10-03 Thread cs
On 04Oct2016 13:35, Crusier wrote: I am trying to scrap from the (span class= 'Number'). The code looks like this on the pages I am scrapping: 99 10.00(-0.1%) Menu Max Quantity 100.000 Average Quantity 822 Previous Order 96 Max Price 104 Number of Trades 383

[Tutor] beautifulsoup

2016-10-03 Thread Crusier
I am trying to scrap from the (span class= 'Number'). The code looks like this on the pages I am scrapping: 99 10.00(-0.1%) Menu Max Quantity 100.000 Average Quantity 822 Previous Order 96 Max Price 104 Number of Trades 383 Min Price 59 Total Amou

[Tutor] Beautifulsoup Queries

2015-12-08 Thread Crusier
Dear All, I am using Python 3.4, I tried to scrap the web and eventually put those data into a database for analysis. While I am using Beautifulsoup to scrap the web, I encountered 2 problems: 1. Using Beautiful Soup, the webmaster on the other end is using the same class, so I got a whole list o

Re: [Tutor] BeautifulSoup confusion

2009-04-09 Thread Stefan Behnel
Steve Lyskawa wrote: > I am not a programmer by trade but I've been using Python for 10+ years, > usually for text file conversion and protocol analysis. I'm having a > problem with Beautiful Soup. I can get it to scrape off all the href links > on a web page but I am having problems selecting sp

Re: [Tutor] BeautifulSoup confusion

2009-04-09 Thread Kent Johnson
On Thu, Apr 9, 2009 at 7:27 PM, Steve Lyskawa wrote: > I'm having a > problem with Beautiful Soup.  I can get it to scrape off all the href links > on a web page but I am having problems selecting specific URI's from the > output supplied by Beautiful Soup. > What exactly is it returning to me and

[Tutor] BeautifulSoup confusion

2009-04-09 Thread Steve Lyskawa
I am not a programmer by trade but I've been using Python for 10+ years, usually for text file conversion and protocol analysis. I'm having a problem with Beautiful Soup. I can get it to scrape off all the href links on a web page but I am having problems selecting specific URI's from the output

Re: [Tutor] beautifulSoup and .next iteration

2007-04-15 Thread Jon Crump
Daniel, It was kind of you to respond, and your response was a model of clarity. You correctly surmised from my awkward framing of the question, that what I wanted was a list of sibling elements between one named anchor and the next. My problem was, in part, that I still don't think in terms of

Re: [Tutor] beautifulSoup and .next iteration

2007-04-13 Thread Daniel Yoo
> anchors = soup.findAll('a', { 'name' : re.compile('^A.*$')}) > for x in anchors: >print x >x = x.next >while getattr(x, 'name') != 'a': > print x > And get into endless loops. I can't help thinking there are simple and > obvious ways to do this, probably many, but as a rank beg

[Tutor] beautifulSoup and .next iteration

2007-04-05 Thread Jon Crump
As a complete tyro, I've broken my teeth on this web-page scraping problem. I've several times wanted to scrape pages in which the only identifying elements are positional rather than syntactical, that is, pages in which everything's a sibling and there's no way to predict how many sibs there a

[Tutor] BeautifulSoup and Python 2.5

2007-03-07 Thread Kent Johnson
This seems to be a problem with BeautifulSoup and Python 2.5. I spent some time looking at it this morning and tracked down one problem. Below is the email I sent to the BeautifulSoup maintainer. I doubt that either of these problems will actually be a problem in practice. I suggest you install

[Tutor] beautifulsoup - getting an error when NavigableString object is returned

2007-03-03 Thread Clay Wiedemann
I wanted to strip the quotes from IMDB quote pages, just to start learning python. Quotes are not nested, so I got the anchor links that precede them. I thought I could walk down until I hit an HR tag, meanwhile grabbing people and quotes via hits on and . But once I tried to walk down from my hit

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-02 Thread jonasmg
Danny Yoo writes: > > >> And the solution to get the state and capital columns (where there are >> anchors): >> >> for row in table('tr'): >>for cell in row.fetch('a')[0:2]: >>print cell.string > > Hi Jonas, > > That's good to hear! So does everything work for you then? > N

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread Danny Yoo
> And the solution to get the state and capital columns (where there are > anchors): > > for row in table('tr'): >for cell in row.fetch('a')[0:2]: >print cell.string Hi Jonas, That's good to hear! So does everything work for you then? __

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread jonasmg
And the solution to get the state and capital columns (where there are anchors): for row in table('tr'): for cell in row.fetch('a')[0:2]: print cell.string ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread jonasmg
Danny Yoo writes: > > >> > Have you read a Python tutorial? It seems like some of the things you >> > are struggling with might be addressed in general Python material. >> >> >> You consider a thing about me. If I ask something it is because I cannot >> find the solution. I do not it by whim.

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread Danny Yoo
> > Have you read a Python tutorial? It seems like some of the things you > > are struggling with might be addressed in general Python material. > > > You consider a thing about me. If I ask something it is because I cannot > find the solution. I do not it by whim. Hello Jonas, Yes, but don't t

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread jonasmg
Kent Johnson writes: > [EMAIL PROTECTED] wrote: >> Yes, ok. But so, it is only possible get data from a row (rows[0]) >> >> cells=rows[0]('td') >> >> And I want get data from all rows. I have trying with several 'for' setences >> but i can not. > > Can you show us what you tried? > > H

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Yes, ok. But so, it is only possible get data from a row (rows[0]) > > cells=rows[0]('td') > > And I want get data from all rows. I have trying with several 'for' setences > but i can not. Can you show us what you tried? Have you read a Python tutorial? It seems l

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread jonasmg
Kent Johnson writes: > [EMAIL PROTECTED] wrote: >> Kent Johnson writes: >> >> >>>[EMAIL PROTECTED] wrote: >>> >>> List of states: http://en.wikipedia.org/wiki/U.S._state : soup = BeautifulSoup(html) : # Get the second table (list of states). : table = soup.first(

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-04-01 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Kent Johnson writes: > > >>[EMAIL PROTECTED] wrote: >> >> >>>List of states: >>>http://en.wikipedia.org/wiki/U.S._state >>> >>>: soup = BeautifulSoup(html) >>>: # Get the second table (list of states). >>>: table = soup.first('table').findNext('table') >>>: print ta

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread jonasmg
Kent Johnson writes: > [EMAIL PROTECTED] wrote: > >> List of states: >> http://en.wikipedia.org/wiki/U.S._state >> >> : soup = BeautifulSoup(html) >> : # Get the second table (list of states). >> : table = soup.first('table').findNext('table') >> : print table >> >> ... >> >> WY >> Wyo.

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > List of states: > http://en.wikipedia.org/wiki/U.S._state > > : soup = BeautifulSoup(html) > : # Get the second table (list of states). > : table = soup.first('table').findNext('table') > : print table > > ... > > WY > Wyo. > Wyoming > Cheyenne > Cheyenne > src="ht

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread jonasmg
Kent Johnson writes: > [EMAIL PROTECTED] wrote: >> You have reason but the problem is that some cells have anchors. >> Sorry, I forgot myself to say it. >> >> and using: >> >> for row in table('tr'): >> cellText = [cell.string for cell in row('td')] >> print cellText >> >> I get

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > You have reason but the problem is that some cells have anchors. > Sorry, I forgot myself to say it. > > and using: > > for row in table('tr'): > cellText = [cell.string for cell in row('td')] > print cellText > > I get null values in cell with anchors. Ca

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread jonasmg
Kent Johnson writes: > [EMAIL PROTECTED] wrote: >> Kent Johnson writes: >> >> >>>[EMAIL PROTECTED] wrote: >>> From a table, I want to get the cells for then only choose some of them. WY Wyo. ... Using: for row in table('tr'

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Kent Johnson writes: > > >>[EMAIL PROTECTED] wrote: >> >>> From a table, I want to get the cells for then only choose some of them. >>> >>> >>> >>>WY >>>Wyo. >>> >>>... >>> >>> >>>Using: >>> >>>for row in table('tr'): print row.contents >>> >>> ['\n', WY, '\n

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread jonasmg
Kent Johnson writes: > [EMAIL PROTECTED] wrote: >> From a table, I want to get the cells for then only choose some of them. >> >> >> >> WY >> Wyo. >> >> ... >> >> >> Using: >> >> for row in table('tr'): print row.contents >> >>['\n', WY, '\n', Wyo., '\n'] >>[...] >> >>

Re: [Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > From a table, I want to get the cells for then only choose some of them. > > > > WY > Wyo. > > ... > > > Using: > > for row in table('tr'): print row.contents > >['\n', WY, '\n', Wyo., '\n'] >[...] > > I get a new line character between each cell.

[Tutor] BeautifulSoup - getting cells without new line characters

2006-03-31 Thread jonasmg
From a table, I want to get the cells for then only choose some of them. WY Wyo. ... Using: for row in table('tr'): print row.contents ['\n', WY, '\n', Wyo., '\n'] [...] I get a new line character between each cell. Is possible get them without those '\n'? Thanks in advance

Re: [Tutor] BeautifulSoup - deleting tags

2006-03-28 Thread jonasmg
Kent Johnson writes: > [EMAIL PROTECTED] wrote: >> Is possible deleting all tags from a text and how? >> >> i.e.: >> >> s='foo bar; >> foo2 > title="...">bar2' >> >> so, I would get only: foo bar, foo2, bar2 > > How about this? > > In [1]: import BeautifulSoup > > In [2]: s=Beautifu

Re: [Tutor] BeautifulSoup - deleting tags

2006-03-28 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Is possible deleting all tags from a text and how? > > i.e.: > > qwe='foo bar; > foo2 bar2' > > so, I would get only: foo bar, foo2, bar2 How about this? In [1]: import BeautifulSoup In [2]: s=BeautifulSoup.BeautifulSoup('''foo bar; ...: foo2 bar2''') In [4

[Tutor] BeautifulSoup - deleting tags

2006-03-28 Thread jonasmg
Is possible deleting all tags from a text and how? i.e.: qwe='foo bar; foo2 bar2' so, I would get only: foo bar, foo2, bar2 Thanks in advance! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor