title: python 3.6 get text from list
body: <p>I am an absolute beginner, but I have managed to make a working script out of some existing scripts and tutorials. Only one thing I would like to have, unfortunately I can not do that.</p>
  
  <p>So far, I'm getting data from a website that is, for example, "<a href="http://www.example.com/01536496/.../" rel="nofollow noreferrer">http://www.example.com/01536496/.../</a>". Now I have a list (.csv or .txt) with many other numbers in the first column (or in txt-file each number in a new row). Now I want to scrape the web data for all the numbers in the list, so "<a href="http://www.example.com/No_1/.../" rel="nofollow noreferrer">http://www.example.com/No_1/.../</a>", "<a href="http://www.example.com/No_2/.../" rel="nofollow noreferrer">http://www.example.com/No_2/.../</a>" and so on.</p>
  
  <pre><code>from urllib.request import urlopen as uReq
  from bs4 import BeautifulSoup as soup
  import datetime
  
  my_url = 'http://www.example.com/104289633/.../'
  
  uClient = uReq(my_url)
  page_html = uClient.read()
  uClient.close()
  
  page_soup = soup(page_html, "html.parser")
  
  ...
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>For example I have a numbers.txt with: 05543486 3468169 36189994 </p>
  
  <p>Now I want to put each number into the url...</p>
  
  <p>Please can someone help me. I would be very grateful.</p>
  
  <p><strong>Update</strong></p>
  
  <p>After trying to use the code from Andersson...</p>
  
  <pre><code>from urllib.request import urlopen as uReq
  from bs4 import BeautifulSoup as soup
  import datetime
  
  # Get list of numbers
  with open("numbers.txt") as f:
      content = f.read()
      numbers = content.split()
  
  # Handle each URL in a loop
  for number in numbers:
      my_url = 'https://www.immobilienscout24.de/expose/%s#/' %number
  
  uClient = uReq(my_url)
  page_html = uClient.read()
  uClient.close()
  
  print(my_url)
  
  page_soup = soup(page_html, "html.parser")
  
  containers = page_soup.find_all("div", {"class":"grid-item padding-desk-right-xl desk-two-thirds lap-one-whole desk-column-left flex-item palm--flex__order--1 lap--flex__order--1"})
  
  filename = "results_"+current_datetime+".csv"
  f = open(filename, "w")
  
  headers = "titel##adresse##criteria##preis##energie##beschreibung##ausstattung##lage\n"
  
  f.write(headers)
  
  ...
  
      f.write(titel + "##" + adresse + "##" + criteria.replace("    ", "; ") + "##" + preis.replace("    ", "; ") + "##" + energie.replace("    ", "; ") + "##" + beschreibung.replace("\n", " ") + "##" + ausstattung.replace("\n", " ") + "##" + lage.replace("\n", " ") + "\n")
  
  f.close()
  </code></pre>