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
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
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
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
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
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
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
> 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
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
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
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
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
> 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?
__
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
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.
> > 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
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
[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
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(
[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
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.
[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
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
[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
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'
[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
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']
>>[...]
>>
>>
[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.
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
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
[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
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
32 matches
Mail list logo