Thanks ssteinerX,
I have been working my way through the documentation, and at this
point it would really help me if I had an example of a script that
actually retrieves data from an existing URL. Any URL. Any data. The
documentation includes a real-world example script. That example was
probably included in order to help newcomers get a quick overall view
of a script and how it accesses data in a URL:
[Start Quote]
Here's a real-world example. It fetches the ICC Commercial Crime
Services weekly piracy report, parses it with Beautiful Soup, and
pulls out the piracy incidents:
import urllib2
from BeautifulSoup import BeautifulSoup
page = urllib2.urlopen("
http://www.icc-ccs.org/prc/piracyreport.php")
soup = BeautifulSoup(page)
for incident in soup('td', width="90%"):
where, linebreak, what = incident.contents[:3]
print where.strip()
print what.strip()
print
[end Quote]
Sadly,
http://www.icc-ccs.org/prc/piracyreport.php no longer exists.
If it did, I might start to understand where "incident" lies in the
URL, and what the "incident.contents" looks like. I'm not stuck; I'm
just not started, and a working sample script on that order would help
me get started, so the next question I have will be a little better
informed.
So, is there a real-world example script that would be similar in
concept to that example script in the documentation, but which works?
Thanks,
Drew
On Nov 25, 5:32 am, "
sstein...@gmail.com" <
sstein...@gmail.com> wrote:
> On Nov 24, 2009, at 11:03 PM, Drew Tronvig wrote:
>
> > I'm trying to get my head around BeautifulSoup and Python, and I
> > haven't been able to find any simple real-world example that refers to
> > a URL that currently exists. Something like the real-world example in
> > the the BeautifulSoup documentation right above
> >
http://www.crummy.com/software/BeautifulSoup/documentation.html#Parsi...