title: Python Properly replace some content from Variable
body: <p>I'm trying to scraping using Yahoo Engine. Using keyword like &quot;python&quot;.</p>
  <p>I have wrote this little program :</p>
  <pre><code>query = &quot;python&quot;
  url = {&quot;https://fr.search.yahoo.com/search?p=&amp;fr=yfp-search-sb&quot;,
  &quot;https://fr.search.yahoo.com/search?p=&amp;fr=yfp-search-sb&amp;b=11&amp;pz=10&amp;pstart=5&quot;}
  
  def checker():
      for yahoo in url:
          yahooo = yahoo.replace(&quot;&amp;fr&quot;,query + &quot;&amp;fr&quot;) 
      r = requests.get(yahooo)
      soup = bs(r.text, 'html.parser')
      links =  soup.find_all('a')
      for link in soup.find_all('a'):
          a = link.get('href')
          unquote(a)
          print(&quot;Urls : &quot; + a)
          with open(&quot;Yahoo.txt&quot;, mode=&quot;a&quot;,encoding=&quot;utf-8&quot;) as fullz:
              fullz.write(a + &quot;\n&quot;)
              fullz.close()
          lines_seen = set() # holds lines already seen
          outfile = open(&quot;Yahoonodup.txt&quot;, &quot;w&quot;, encoding=&quot;utf-8&quot;)
          for line in open(&quot;Yahoo.txt&quot;, &quot;r&quot;, encoding=&quot;utf-8&quot;):
              if line not in lines_seen: # not a duplicate                               
                  outfile.write(line)
                  lines_seen.add(line)
          outfile.close()
              
  checker()
  </code></pre>
  <p>My output file contains some urls like this :</p>
  <pre><code>https://r.search.yahoo.com/cbclk2/dWU9MURCNjczQ0UwNThBNDk4MyZ1dD0xNjE2ODAzMTA5MDE4JnVvPTg0OTM3NTA2NTgyMzY5Jmx0PTImcz0xJmVzPVdHbFZxQzRHUFNfemNveGNLaUgxVkpoX3lXV2N2WFhiQkRfZklRLS0-/RV=2/RE=1616831909/RO=10/RU=https%3a%2f%2fwww.bing.com%2faclick%3fld%3de8BWTO-5A13W9y2D2Aw39AjjVUCUyb98EJf6bSa7R7dGxGXelKfNh7KW94OonXABpN7Bo9YkZqB22Evk3cfTIpJi3aGEXXKJMtDqnaNUDUVcsehzFOYyr09GoYqUE-iUywRWeOnV4aeACKf4_YX6dE2BVZAbqkvWj4HQMqeB_Fl1KlwT1v%26u%3daHR0cHMlM2ElMmYlMmZ2ZXJnbGVpY2guZm9jdXMuZGUlMmZ3YXNjaG1hc2NoaW5lJTJmJTNmY2hhbm5lbCUzZGJpbmclMjZkZXZpY2UlM2RjJTI2bmV0d29yayUzZG8lMjZjYW1wYWlnbiUzZDQwNzE4NzU1MCUyNmFkZ3JvdXAlM2QxMzU4OTk2OTA3NDAxNDE4JTI2dGFyZ2V0JTNka3dkLTg0OTM3NjAxMjIzNjUyJTNhbG9jLTcyJTI2YWQlM2Q4NDkzNzUwNjU4MjM2OSUyNmFkLWV4dGVuc2lvbiUzZA%26rlid%3d0fc40f09a4b6109e9c726f57d193ec0e/RK=2/RS=3w4U9AT_OQyaVSF.6KLwzWuo_LU-;_ylc=cnQDMQ--?IG=0ac9439bcf3f4ec087000000005bf464
  </code></pre>
  <p>And I want to change it into the real links :</p>
  <pre><code>https://vergleich.focus.de/waschmaschine/?channel=bing&amp;device=c&amp;network=o&amp;campaign=407187550&amp;adgroup=1358996907401418&amp;target=kwd-84937601223652:loc-72&amp;ad=84937506582369&amp;ad-extension=
  </code></pre>
  <p>It's possible ?</p>