Find Source Code from Website

HTMLperson5 0 Tallied Votes 169 Views Share

This is a program using the urllib module to find the (html/any client-side script) source code of any website which exists.
Have fun!

import urllib
sourcecode = urllib.urlopen("http://www.any-website.com").read() #Replace any-website with whatever you like
print sourcecode
M.S. 53 Light Poster

if you want it to work with every site,I guess you need to consider the encoding too:

print sourcecode.decode("utf8")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.