title: How to change values of url query in python?
body: <pre><code> url = "http://www.example.com?type=a&amp;type1=b&amp;type2=c"
   urllist = get_urllist(url)
   trigger = ["'or '1'='1'"," 'OR '1'='2'","'OR a=a"]
  
  def get_urllist(url): 
      url_parsed = urlparse.urlparse(url)
      #extract the query parameters of the URL 
      query =  urlparse.parse_qs(url_parsed.query)
      #get the list of query 
      query_list = query_list(query)
      #Get Base url 
      url = urlparse._replace(query=None).geturl()
      #modify url to get url_list 
      for query in query_list : 
         # change the original query to get the expected result 
  
  
   return url_list 
  
  
  def query_list(query):
       for t in trigger:
           for key, value in query.items():
              query[key] += t
           query_list.append(query) 
  
       return query_list
  </code></pre>
  
  <p>How to return a list of URLs by changing the query parameter values? </p>
  
  <p>Original url = "<a href="http://www.example.com?type=a&amp;type1=b&amp;type2=c" rel="noreferrer">http://www.example.com?type=a&amp;type1=b&amp;type2=c</a>"</p>
  
  <p>Expected Result: </p>
  
  <p>Url_list=  ["<a href="http://www.example.com?type=a" rel="noreferrer">http://www.example.com?type=a</a>'OR '1'='1'&amp;type1=b'OR '1'='1'&amp;type2=c'OR '1'='1'","<a href="http://www.example.com?type=a" rel="noreferrer">http://www.example.com?type=a</a>'OR '1'='2'&amp;type1=b'OR '1'='2'&amp;type2=c'OR '1'='2'","<a href="http://www.example.com?type=a" rel="noreferrer">http://www.example.com?type=a</a>'OR a=a&amp;type1=b'OR a=a&amp;type2=c''OR a=a" ]</p>