Extracting HTML Documents from Web Pages Using Python:
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

Bookmark and Share

Related Posts:



Archive


"Action is the real measure of intelligence" ~Napoleon Hill

Twitter

Tumblr

Google +