Question: Can you extract HTML documents from live web pages without even using an internet browser?
Answer: Yes you can. All you need is a Python interpreter and these short commands:
>>> import urllib
>>> sock = urllib.urlopen("PAGE URL")
>>> htmlSource = sock.read()
>>> sock.close()
>>> print htmlSource
Illustration (click to enlarge):

Python Related Posts:
* Will Real Python Hackers Please Stand Up
* How to Rescue Windows Files Using Linux and Python
* Highly Recommended Books on Python
Extracting HTML Documents from Web Pages Using Python
Related Posts:
Posted by jun auza at 11:46 PM
Labels: programming
Subscribe to:
Post Comments (Atom)


0 comments:
Comments