0

I would like to recover the redirection url from a url that doesn't work.

to better understand my problem here is an example:

start url:

wtm.actualite.20minutes.fr/redirection.html?m=3e2b20a2f1f6dd3c60608f54d7ad4dc5&c=fr&u=https%3A%2F%2Fwww.20minutes.fr%2Fmonde%2F2943831-20210103-presidentielle-americaine-onze-nouveaux-senateurs-annoncent-contesteront-certification-victoire-joe-biden%3Fxtor%3DEREC-182-%5Bactualite%5D&dc=yt0U%2FI8COMJyjwQQ1fA2kVEXpoP0nsZydMTZS6jTm2DdKasFuV%2FVA7rEphhqMfGAy%2FlztUlVN4MJt5tg%2FQXfJwmXMRQL8g3Gfwhl%2BsjkkYmd%2BDxDUhb%2BpPRL%2BNsiDETNQeP3MmrQ6ATGJT%2Blf46Zg4DHd%2FzaXy%2B7UAuxatp2UcVd39HKuuMfQHmyDV%2BAxSAJrd4x5CxHqy3uTtZoQEjwGdZ%2FRtoa7YLOWLKhN9tg4TM%3D

arrival url: (given by the web browser)

https://www.20minutes.fr/monde/2943831-20210103-presidentielle-americaine-onze-nouveaux-senateurs-annoncent-contesteront-certification-victoire-joe-biden?xtor=EREC-182-[actualite]

thank you in advance for your help :)

Nounes MEZ
  • 71
  • 1
  • 3
  • What have you tried so far? Can you show us some code you've written to try to solve this issue? – John Gordon Jan 04 '21 at 18:13
  • yes of course, here are the various tracks I tried: 1- with "response" library by executing the following command 'response = requests.get('url', verify=False, allow_redirects=True)''. 2- by following this answer but it doesn't work on my side: https://stackoverflow.com/questions/36070821/how-to-get-redirect-url-using-python-requests – Nounes MEZ Jan 05 '21 at 14:18
  • my main goal is to find the correct link (so in my case it's https://www.20minutes.fr/monde/2943831-20210103-presidentielle-americaine-onze-nouveaux-senateurs-annoncent-contesteront-certification-victoire-joe-biden?xtor=EREC-182- [news]) so that I can post it in the scraping newspaper3k library. – Nounes MEZ Jan 05 '21 at 14:26

0 Answers0