Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
Now we will use the get function from the requests module to make a request to a web page. The get method sends a GET request to the specified URL and returns a requests.Response object. You can read more about requests from the below link:
https://requests.readthedocs.io/en/master/user/quickstart/
Next, we will use the fromstring function to parse XML from a string directly into an Element, which is the root element of the parsed tree.
Use the get function to get the URL content:
page = requests.<<your code goes here>>(amazon_url, headers = headers)
Use the fromstring function to parse the XML from the string of the page and store it in the parser variable
parser = html.<<your code goes here>>(page.content)
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...