the first page if you likeyou can switch to the we can construct well-formed regular expression to match and extract the link values from the above text as followshref="http[ ]?:/+?our regular expression looks for strings that start with "href=""href="double quote the question mark behind the [ ]indicates to search for the string "httpfollowed by zero or one "sthe question mark added to the +indicates that the match is to be done in "non-greedyfashion instead of "greedyfashion non-greedy match tries to find the smallest possible matching string and greedy match tries to find the largest possible matching string we add parentheses to our regular expression to indicate which part of our matched string we would like to extractand produce the following programsearch for link values within url input import urllib requesturllib parseurllib error import re import ssl ignore ssl certificate errors ctx ssl create_default_context(ctx check_hostname false ctx verify_mode ssl cert_none url input('enter 'html urllib request urlopen(urlcontext=ctxread(links re findall( 'href="(http[ ]?:/*?)"'htmlfor link in linksprint(link decode()codethe ssl library allows this program to access web sites that strictly enforce https the read method returns html source code as bytes object instead of returning an httpresponse object the findall regular expression method will give us list of all of the strings that match our regular expressionreturning only the link text between the double quotes when we run the program and input urlwe get the following output