title: Python Web Scraping with Multiple URLs + merge datas
body: <p>What I'm trying to do is </p>
  
  <ul>
  <li>Take multiple URLs.</li>
  <li>Take h2 text in every URL.</li>
  <li>Merge h2 texts and then write csv.</li>
  </ul>
  
  <p>In this code, I did:
  Take one URL. Take h2 text in URL.</p>
  
  <pre><code>from bs4 import BeautifulSoup as soup
  from urllib.request import urlopen as uReq
  
  page_url = "https://example.com/ekonomi/20200108/"
  
  #i am trying to do | urls = ['https://example.com/ekonomi/20200114/', 'https://example.com/ekonomi/20200113/', 'https://example.com/ekonomi/20200112/', 'https://example.com/ekonomi/20200111/]
  
  uClient = uReq(page_url)
  
  page_soup = soup(uClient.read(), "html.parser")
  uClient.close()
  
  # finds each product from the store page
  containers = page_soup.findAll("div", {"class": "b-plainlist__info"})
  
  out_filename = "output.csv"
  
  headers = "title \n"
  
  
  f = open(out_filename, "w")
  f.write(headers)
  
  container = containers[0]
  
  for container in containers:
      title = container.h2.get_text()
  
      f.write(title.replace(",", " ") + "\n")
  
  f.close()  # Close the file
  </code></pre>