Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing in

  Enroll Now

Scraping Amazon Product Reviews - Get URL content

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:

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)

No hints are availble for this assesment

Answer is not availble for this assesment

Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...