title: How can i call URL's from text file one by one
body: <p>I want to parse on one website with some URL's and i created a text file has all links that i want to parse. How can i call this URL's from the text file one by one on python program. </p>
  
  <pre><code>from bs4 import BeautifulSoup
  import requests
  
  soup = BeautifulSoup(requests.get("https://www.example.com").content, "html.parser")
  
  for d in soup.select("div[data-selenium=itemDetail]"):
      url = d.select_one("h3[data-selenium] a")["href"]
      upc = BeautifulSoup(requests.get(url).content, "html.parser").select_one("span.upcNum")
      if upc:
          data = json.loads(d["data-itemdata"])
          text = (upc.text.strip())
          print(upc.text)
          outFile = open('/Users/Burak/Documents/new_urllist.txt', 'a')
          outFile.write(str(data))
          outFile.write(",")
          outFile.write(str(text))               
          outFile.write("\n")
          outFile.close()
  </code></pre>
  
  <p><strong>urllist.txt</strong></p>
  
  <pre><code>https://www.example.com/category/1
  category/2
  category/3
  category/4
  </code></pre>
  
  <p>Thanks in advance</p>