After URL.replace URL has been divided into two parts. Replaced query has been in text format hence it’s not a proper URL how to fix it. Can some one please help me here.
As it’s an invalid UTL got 404 error.
ERROR: requests.exceptions.HTTPError: 404 Client Error: Not Found for url:
‘https://www.example.com?param=specialanother**[]=char’**
import requests
url = 'https://www.example.com?param=specialanother[]=char'
url = requote_uri(urlunparse([scheme, netloc, path, None, query, fragment]))
url = url.replace("%5B", "[").replace("%5D", "]")
self.url = "".join(url)
[]=char part is in text not part of URL..