Linked Questions
29 questions linked to/from How can I percent-encode URL parameters in Python?
1
vote
2
answers
680
views
python: encode a url with percentage signs? [duplicate]
I am trying to convert the following url
http://www.website.com/search/si/1/doctors/Vancouver, BC
to
http://www.website.com/search/si/1/doctors/Vancouver%2C%20BC
I tried
urllib.quote('http://www....
2
votes
1
answer
321
views
Encoding Japanese in Python [duplicate]
I need to encode encode Japanese words to fit the encoding of the word in a link. The problem is when I encode them they're slightly off.
I need it to be:
%E5%A4%89%E4%BD%93
instead it's:
b'\xe5\...
0
votes
1
answer
131
views
How to convert encoded unicode string to native string in Python [duplicate]
How do I convert a string that looks like the following:
s1 = u'...
1
vote
0
answers
117
views
Url parameters in Flask (modifiers '+', '-' to sort) [duplicate]
I'm ussing Flask with Python3. I need to sort my objects ussing the modifier '+' or '-' in the order argumnent of my url.
/objects?order=name+
I use the request.args(ImmutableDict) object to get GET ...
0
votes
0
answers
74
views
Python: How to scramble/unscramble a string to use as data in a URL [duplicate]
I want to send a string of text that can contain special chars via a URL. (The string might contain chars that are not suitable to send as a URL.)
To do this do i want to scramble the string to ...
0
votes
0
answers
20
views
Python getting a url request to work with special characters [duplicate]
url = ("websitetogetdatafrom/vandcenter syd/sites/"
"{}/histdata0/youngest".format('vestre boulevard f77r370 -ny logger 1'))
stuff = "\"select\": [\"{}\&...
569
votes
39
answers
819k
views
How to urlencode data for curl command?
I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site. I need to url encode the value to make sure that special characters are processed properly....
195
votes
7
answers
280k
views
How to encode the plus (+) symbol in a URL
The URL link below will open a new Google mail window. The problem I have is that Google replaces all the plus (+) signs in the email body with blank space. It looks like it only happens with the + ...
15
votes
1
answer
26k
views
Using Python and Mechanize to submit form data and authenticate
I want to submit login to the website Reddit.com, navigate to a particular area of the page, and submit a comment. I don't see what's wrong with this code, but it is not working in that no change is ...
5
votes
2
answers
15k
views
Django initial value of choicefield
I'm having a strange problem where I can't seem to set the initial value of one of the fields in my forms in django.
My model field is:
section = models.CharField(max_length=255, choices=(('...
3
votes
1
answer
3k
views
python convert chinese characters in url
I have a url like
href="../job/jobarea.asp?C_jobtype=經營管理主管&peoplenumber=151",
this is shown in inspect element.
But when opened in new tab it is showing as
../job/jobarea.asp?C_jobtype=%B8g%...
1
vote
2
answers
2k
views
Connect mongodb from AWS lambda python using IAM
I was using until now pymongo[srv] to connect my AWS lambda to my MongoDB cluster with:
mongodb+srv://username:[email protected]/database
Now I am trying to setup the IAM role connection and in ...
1
vote
2
answers
2k
views
Download online PDF files named with special characters
I am using below codes to download online PDF files. It works fine for most files.
# -*- coding: utf8 -*-
import urllib2
import shutil
import urlparse
import os
def download(url, fileName=None):
...
1
vote
1
answer
1k
views
Is there a function in python to convert html entities to percent encoding?
I am retrieving Japanese and Chinese text from a website in the form of JSON using urllib2 and converting them to HTML entities using encode(xmlcharrefreplace).
I then use curl to post the same ...
0
votes
1
answer
2k
views
How do you build a URL that contains a username and password from user input in Python?
I see you can parse usernames and passwords with:
from urlparse import urlparse
r = urlparse('http://myuser:[email protected]')
print r.username
# => 'myuser'
How can I go the other way? I can't ...