def get_surveys(self, url=_SURVEYS_URL):
res = self.client._get(url=url, expected_status_code=<NUM_LIT:200>)<EOL>soup = BeautifulSoup(res.text, _DEFAULT_BEAUTIFULSOUP_PARSER)<EOL>surveys_soup = soup.select(_SURVEYS_SELECTOR)<EOL>survey_list = []<EOL>for survey_soup in surveys_soup:<EOL><INDENT>survey_name = _css_select(survey_soup, _SURVEY_NAME_SELECTOR)<EOL>try:<EOL><INDENT>url = survey_soup.select(_SURVEY_URL_SELECTOR)[<NUM_LIT:0>]["<STR_LIT>"]<EOL><DEDENT>except:<EOL><INDENT>raise ValueError("<STR_LIT>".format(_SURVEY_URL_SELECTOR))<EOL><DEDENT>try:<EOL><INDENT>id = int(url.split("<STR_LIT>")[<NUM_LIT:1>].split("<STR_LIT:&>")[<NUM_LIT:0>])<EOL><DEDENT>except:<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>url))<EOL><DEDENT>survey_location = _css_select(survey_soup,<EOL>_SURVEY_LOCATION_SELECTOR)<EOL>try:<EOL><INDENT>survey_epoch = int(survey_soup.select(<EOL>_SURVEY_DATE_SELECTOR)[<NUM_LIT:0>]["<STR_LIT>"])<EOL>survey_date_obj = datetime.fromtimestamp(survey_epoch)<EOL>survey_date = _datetime_object_to_rfc_date_str(survey_date_obj)<EOL><DEDENT>except:<EOL><INDENT>raise ValueError("<STR_LIT>".format(_SURVEY_DATE_SELECTOR))<EOL><DEDENT>survey_img_nb_and_size = survey_soup.select(<EOL>_SURVEY_IMG_NB_AND_SIZE_SELECTOR)<EOL>try:<EOL><INDENT>survey_img_nb = survey_img_nb_and_size[<NUM_LIT:0>].text<EOL>survey_img_nb = int(survey_img_nb.split("<STR_LIT:U+0020>")[<NUM_LIT:0>])<EOL><DEDENT>except:<EOL><INDENT>raise ValueError("<STR_LIT>".format(survey_img_nb_and_size))<EOL><DEDENT>try:<EOL><INDENT>survey_size = survey_img_nb_and_size[<NUM_LIT:1>].text<EOL><DEDENT>except:<EOL><INDENT>raise ValueError("<STR_LIT>".format(survey_img_nb_and_size))<EOL><DEDENT>sensor = _css_select(survey_soup, _SURVEY_SENSOR_SELECTOR)<EOL>survey = Survey(<EOL>id=id, name=survey_name, url=url,<EOL>date=survey_date, location=survey_location,<EOL>image_nb=survey_img_nb, size=survey_size, sensor=sensor)<EOL>survey_list.append(survey)<EOL><DEDENT>return survey_list<EOL>
Function to get the surveys for the account