As explained in the title, whatever I do, I can't get webbrowser to open the URL I want it to open.
I tried escaping the double quotes with \
I tried using %22 in the URL instead of "
No matter what, the end URL ends up effectively turning " into %2522
I know that %25 represents %, which means, somehow " is being turned into %22 first and then the % in that is being turned into %25. Makes no sense, I don't know why it would get processed twice anyway.
Example URL (what I get when I print the variable in python):
https://domain.com/do?q=item:(("abc")+OR+("def")+OR+("ghj"))
What webbrowser opens in Chrome:
https://domain.com/do?q=item:((%2522abc%2522)+OR+(%2522def%2522)+OR+(%2522ghj%2522))
Your code is URL encoding twice. %2522
is a double encoding of "
as the encoding of %
is %25
.
> decodeURIComponent('%2522')
"%22"
> decodeURIComponent('%22')
"\""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With