dimanche 16 mai 2021

Problem while joining two URL components with urllib

Recently I wanted to make a Python program which can crawl a website. I want to join the two components which should give the following output using urllib.parse.urljoin

https://test.com/endpoint + test.php =  https://test.com/endpoint/test.php

However, it is showing the following output:

https://test.com/test.php

Is there any way which can help me to get my desired output?




Aucun commentaire:

Enregistrer un commentaire