I am using Python and Google App Engine.
I need to get access to certain webpage by adding some elements to the url.
What is the syntax for adding a GET parameter to a URL?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
http://www.foo.com/somepath?keyword1=value1&keyword2=value2&keyword3=value3
You put
?
in the end of the url. After the?
you putvar1=val1&var2=val2& ...
.For example, if your raw url (without the get parameters) is http://www.example.com/ and you have two parameters,
param1=7
andparam2=seven
, then the full url should be:http://www.example.com/?param1=7¶m2=seven.
If you want to generate the
param1=7¶m2=seven
in python, you can use a parameter dictionary, like this:The value of
parameters
is'param1=7¶m2=seven'
so you can append theparameters
string to a url like this:Now the value of
url
is'http://www.example.com/?param1=7¶m2=seven'
.I am fairly certain this has been asked many times before, but the query parameters start with ? and are separated by & like so:
http://www.site.com/script.php?key=value&var=num