Question: Write a function to dump the html content, and save it in the same directory of your python script. The name of the saved html
Write a function to dump the html content, and save it in the same directory of your python script. The name of the saved html file should include the current time stamp.
I currently have been trying this code. But Repl.it says "ModuleNotFoundError: No module named 'urllib2'". Could someone point out what i am doing wrong and help me include the current time stamp using 'datetime'. The format for the date and time should be YYYY_MM_DD_HH_MM_SS.
import urllib2
def webpagedumb(url):
req = urllib2.Request('https://en.wikipedia.org/wiki/Web_page')
response = urllib2.urlopen(req)
the_page = response.read()
return
Step by Step Solution
There are 3 Steps involved in it
Lets address the issues in your current code and achieve the desired task Issue Explanation ModuleNo... View full answer
Get step-by-step solutions from verified subject matter experts
