Parsing

M

Michael

I have been assigned a project to parse a webpage for data using
Python. I have finished only basic tutorials. Any suggestions as to
where I should go from here? Thanks in advance.
 
S

Simon Bayling

(e-mail address removed) (Michael) wrote in
I have been assigned a project to parse a webpage for data using
Python. I have finished only basic tutorials. Any suggestions as to
where I should go from here? Thanks in advance.

Parsing? What are you looking for?
Do you have to download the page as well?

If it's a fairly simple thing to find, you could use something like;

If the data to find is more complicated, or you need to parse the HTML as
well, you should look at more string methods, maybe regular expressions
(import re)...

Cheers,
Simon.
 
P

Peter van Kampen

I have been assigned a project to parse a webpage for data using
Python. I have finished only basic tutorials. Any suggestions as to
where I should go from here? Thanks in advance.


Try to be a little more specific. Parse for what? Links? Images? Tags?

Anyway. A good start might be the HTMLParser that comes with the
batteries since 2.2 if I remember correctly. See

http://www.python.org/doc/current/lib/htmlparser-example.html

for a tiny example.

PterK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top