03-08-2014, 11:38 PM
This is really simple and easy to make. There are only a few problems and they will be listed at the end.
How does this work?
Basically, it finds your target website, decodes it and writes it toan HTML file.
What does it not do?
The only needed imports for this file is urllib, and sys. Any others are quite useless to us.
Next we just check the version of the user, if it is greater than version 2, it imports urllib.request as urlreq. If not, urllib2 is imported as urlreq.
Now we prompt the user for their target.
Now that we've prompted the user, we need to build our path name, the name of the file that we save, and our website request that will tell us which website to steal the HTML from.
All we have to do now is open the website and save it to an HTML file.
The next few lines of code just open the website.
It's time to save your ripped/stolen/peanut buttered website.
We're finished.
Problems and caveats:
Full code:
How does this work?
Basically, it finds your target website, decodes it and writes it toan HTML file.
What does it not do?
- Save images.
- Save external CSS
- Write to file IF there is a special character in the file. Ex: \u253c
The only needed imports for this file is urllib, and sys. Any others are quite useless to us.
Hidden Content
Next we just check the version of the user, if it is greater than version 2, it imports urllib.request as urlreq. If not, urllib2 is imported as urlreq.
Hidden Content
Now we prompt the user for their target.
Hidden Content
Now that we've prompted the user, we need to build our path name, the name of the file that we save, and our website request that will tell us which website to steal the HTML from.
Hidden Content
All we have to do now is open the website and save it to an HTML file.
The next few lines of code just open the website.
Hidden Content
It's time to save your ripped/stolen/peanut buttered website.
Hidden Content
We're finished.
Problems and caveats:
- Special characters cause the entire project to fail. Ex: \u253c
Full code:
Hidden Content