How to get the id parameters in the url of the current web page by python

Novice, first contact with python, server environment: window 2008server+IIS+python 2.7.8

as mentioned in the question, how does python get the id parameters in the url of the current web page?

for example, the current URL is: www.abc.com/index.py?id=123456

how to get this id value, 123456

must be written in python.

Jun.24,2021

import urlparse
urldata = "http://en.wikipedia.org/w/api.php?action=query&ctitle=FA"
result = urlparse.urlparse(urldata)
print result
print urlparse.parse_qs(result.query)

< H2 > get < / H2 > in a regular way
import re
 
pattern = re.compile(r'id=(\d+)')   -sharp 
result1 = pattern.findall('www.abc.com/index.py?id=123456')
 
print(result1)
Menu