-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.mts
More file actions
25 lines (22 loc) · 990 Bytes
/
Copy pathmain.mts
File metadata and controls
25 lines (22 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const params = new URLSearchParams();
params.append('_diputadomodule_idLegislatura', '15');
// params.append('_diputadomodule_grupo', 'all');
// params.append('_diputadomodule_formacion', 'all');
params.append('_diputadomodule_filtroProvincias', '[]');
// params.append('_diputadomodule_genero', '0');
// params.append('_diputadomodule_tipo', '0');
// params.append('_diputadomodule_nombre', '');
// params.append('_diputadomodule_apellidos', '');
// params.append('_diputadomodule_nombreCircunscripcion', '');
const response = await fetch(
'https://www.congreso.es/en/busqueda-de-diputados?p_p_id=diputadomodule&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=searchDiputados&p_p_cacheability=cacheLevelPage',
{
headers: {
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
referrer: 'https://www.congreso.es/en/busqueda-de-diputados',
body: params.toString(),
method: 'POST',
},
);
console.log(await response.text());