Project- Exploring Web Scraping: Python Adventures on Wikipedia and Amazon

10 / 11

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:

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.

INSTRUCTIONS
  • 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)
    
See Answer

No hints are availble for this assesment


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

Loading comments...