Chamawix / scrapping_vdm

Petit programme de scrapping du site vdm
0 stars 0 forks source link

Fetch not working on osx ? #1

Closed pocman closed 6 years ago

pocman commented 6 years ago

Hi,

I have this error trying to enter the fetch command. Could you provide an endpoint or fix this issue ?

Please enter the "fecth" command to fetch all the data :
fetch
not from linux bash
Chamawix commented 6 years ago

Error in request_form, patched and corrected.

pocman commented 6 years ago

ça fonctionne un peu mieux, mais j'ai toujours un soucis : (Est ce que tu pourrais ajouter les .pyc dans le .gitignore ?)

Please enter the "fecth" command to fetch all the data :
fetch
Invalid return character or leading space in header: Host
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [02/Oct/2017 13:57:24] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [02/Oct/2017 13:57:25] "GET /favicon.ico HTTP/1.1" 404 -
-1
-1
127.0.0.1 - - [02/Oct/2017 13:57:57] "GET /api/posts HTTP/1.1" 200 -
127.0.0.1 - - [02/Oct/2017 13:58:29] "GET /api/posts/ HTTP/1.1" 404 -
Chamawix commented 6 years ago

C'est ajouté !

Concernant l'app : Je n'ai pas routé l'adresse api/posts/ (d'ou l'erreur 404), et les adresses données dans l'exercice n'étaient pas compatible avec flasks, d'ou le changement du "?" en "/".

Actuellement, ce qui marche, c'est indiqué dans README : 127.0.0.1/api/posts -> affiche les 200 derniers posts 127.0.0.1/api/posts/ -> récupère le post d'ID donné, si il existe 127.0.0.1/api/posts/author= -> récupère tous les postes d'un auteur donné 127.0.0.1/api/posts/from=<2017-09-28T09:00:00Z>&to=<2017-12-31T00:00:00Z> -> récupère tous les postes entre ces deux dates

en respectant bien le format pour la date (sinon erreur 404).

2017-10-02 14:00 GMT+02:00 Thomas notifications@github.com:

ça fonctionne un peu mieux, mais j'ai toujours un soucis : (Est ce que tu pourrais ajouter les .pyc dans le .gitignore ?)

Please enter the "fecth" command to fetch all the data : fetch Invalid return character or leading space in header: Host

  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 127.0.0.1 - - [02/Oct/2017 13:57:24] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [02/Oct/2017 13:57:25] "GET /favicon.ico HTTP/1.1" 404 - -1 -1 127.0.0.1 - - [02/Oct/2017 13:57:57] "GET /api/posts HTTP/1.1" 200 - 127.0.0.1 - - [02/Oct/2017 13:58:29] "GET /api/posts/ HTTP/1.1" 404 -

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Chamawix/scrapping_vdm/issues/1#issuecomment-333513860, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaEh3LqmelnmE3BjOKs7gEPqpTTE96vks5soNBOgaJpZM4PqR5S .

pocman commented 6 years ago

Dans mon cas, le fetch échoue avec Invalid return character or leading space in header: Host. Et /api/posts retourne ensuite -1

Chamawix commented 6 years ago

C'est résolu, l'erreur venait de l'utilisation d'une ancienne version de request, qui supportait les espaces dans les urls, ce qui n'est plus le cas maintenant pour cause de sécurité. Il y avait un espace dans le fetch.

J'ai mis à jour ma version de la librairie, et j'ai corrigé le soucis.

J'attends votre retour.

2017-10-02 15:05 GMT+02:00 Thomas notifications@github.com:

Dans mon cas, le fetch échoue avec Invalid return character or leading space in header: Host. Et /api/posts retourne ensuite -1

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Chamawix/scrapping_vdm/issues/1#issuecomment-333528426, or mute the thread https://github.com/notifications/unsubscribe-auth/AHaEh9xIQqeTIHQvtXttyPu81vIbMxb8ks5soN-lgaJpZM4PqR5S .

pocman commented 6 years ago

Ok, c'est corrigé de mon coté.