Obtaining Webpage Source with Python

Pierre-Frédéric Caillaud peufeu at free.fr
Thu Jun 24 02:30:09 EDT 2004


> pyPage = open('http://www.python.org/index.html',r).read()

	using open() for local files and ORLs is called url-fopen and works in  
PHP, which is a major security hole, because it even allows one to  
include() code files from the web without knowing it, that kind of thing...

	python has two functions so you know what you're doing.

	If your webpage needs cookies or something, you'll need urllib2

	If you wanna parse it afterwards use Htmllib or BeautifulSoup



More information about the Python-list mailing list