Obtaining Webpage Source with Python

Pierre-Frédéric Caillaud peufeu at free.fr
Thu Jun 24 08:30:09 CEST 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