just comments that outline the rest of your program step download the web page let' implement the code for downloading the page make your code look like the following#python downloadxkcd py downloads every single xkcd comic import requestsosbs url 'starting url os makedirs('xkcd'exist_ok=truestore comics in /xkcd while not url endswith('#')download the page print('downloading page % urlres requests get(urlres raise_for_status(soup bs beautifulsoup(res text'html parser'todofind the url of the comic image tododownload the image todosave the image to /xkcd todoget the prev button' url print('done 'firstprint url so that the user knows which url the program is about to downloadthen use the requests module' request get(function to download it as alwaysyou immediately call the response object' raise_for_status(method to throw an exception and end the program if something went wrong with the download otherwiseyou create beautifulsoup object from the text of the downloaded page step find and download the comic image make your code look like the following#python downloadxkcd py downloads every single xkcd comic import requestsosbs --snip-find the url of the comic image comicelem soup select('#comic img'