from bs4 import BeautifulSoup


def getNewData(response):
  """Extracts hidden input data from a response, returning a data dictionary.

  Extracts hidden input data from a response body, returning a dictionary of
  key-value pairs representing data to send to subsequent requests.

  Args:
      response: The Python requests response object, typically corresponding to
                a simple GET request on the main refugee explorer page.

  Returns:
      A dictionary with key-value pairs representing the data.
  """
  b = BeautifulSoup(response.text, 'html5lib')
  inputs = b.findAll('input', type='hidden')
  newdata = {elem.get('name'): elem.get('value') for elem in inputs}
  return newdata