i need to insert url path to my url from html form
action parameter by using urllib.parse.urljoin
but urljoin it does not work well in this example , for example
url: http://example.com/login/
form: action="/test"
in web browser after click on submit button it will be like this http://example.com/login/test
but in urljoin
will be like this http://example.com/test
>>> from urllib.parse import urljoin
>>> urljoin('http://example.com/login/','/test')
"http://example.com/test/"
my question about the url that got from action parameters for example : action="/test"
in browser http://example.com/login/test
in urllib http://example.com/test
but if the value equal action="/test/"
in browser and urllib http://example.com/test/
, i need to make like browser when the value dose not end with /
any suggestion ?
thanks