from pyquery import PyQuery as pq
import re

sure_links = [
  "http://www.kuranikerimmeali.com/alak-suresi.html", 
  "http://www.kuranikerimmeali.com/kalem-suresi.html", 
  "http://www.kuranikerimmeali.com/muzzemmil-suresi.html", 
  "http://www.kuranikerimmeali.com/muddessir-suresi.html", 
  "http://www.kuranikerimmeali.com/fatiha-suresi.html", 
  "http://www.kuranikerimmeali.com/tebbet-suresi.html", 
  "http://www.kuranikerimmeali.com/tekvir-suresi.html", 
  "http://www.kuranikerimmeali.com/ala-suresi.html", 
  "http://www.kuranikerimmeali.com/leyl-suresi.html", 
  "http://www.kuranikerimmeali.com/fecr-suresi.html", 
  "http://www.kuranikerimmeali.com/duha-suresi.html", 
  "http://www.kuranikerimmeali.com/insirah-suresi.html", 
  "http://www.kuranikerimmeali.com/asr-suresi.html", 
  "http://www.kuranikerimmeali.com/adiyat-suresi.html", 
  "http://www.kuranikerimmeali.com/kevser-suresi.html", 
  "http://www.kuranikerimmeali.com/tekasur-suresi.html", 
  "http://www.kuranikerimmeali.com/maun-suresi.html", 
  "http://www.kuranikerimmeali.com/kafirun-suresi.html", 
  "http://www.kuranikerimmeali.com/fil-suresi.html", 
  "http://www.kuranikerimmeali.com/felak-suresi.html", 
  "http://www.kuranikerimmeali.com/nas-suresi.html", 
  "http://www.kuranikerimmeali.com/ihlas-suresi.html", 
  "http://www.kuranikerimmeali.com/necm-suresi.html", 
  "http://www.kuranikerimmeali.com/abese-suresi.html", 
  "http://www.kuranikerimmeali.com/kadir-suresi.html", 
  "http://www.kuranikerimmeali.com/sems-suresi.html", 
  "http://www.kuranikerimmeali.com/buruc-suresi.html", 
  "http://www.kuranikerimmeali.com/tin-suresi.html", 
  "http://www.kuranikerimmeali.com/kureys-suresi.html", 
  "http://www.kuranikerimmeali.com/kaaria-suresi.html", 
  "http://www.kuranikerimmeali.com/kiyamet-suresi.html", 
  "http://www.kuranikerimmeali.com/humeze-suresi.html", 
  "http://www.kuranikerimmeali.com/murselat-suresi.html", 
  "http://www.kuranikerimmeali.com/kaf-suresi.html", 
  "http://www.kuranikerimmeali.com/beled-suresi.html", 
  "http://www.kuranikerimmeali.com/tarik-suresi.html", 
  "http://www.kuranikerimmeali.com/kamer-suresi.html", 
  "http://www.kuranikerimmeali.com/sad-suresi.html", 
  "http://www.kuranikerimmeali.com/araf-suresi.html", 
  "http://www.kuranikerimmeali.com/cin-suresi.html", 
  "http://www.kuranikerimmeali.com/yasin-suresi.html", 
  "http://www.kuranikerimmeali.com/furkan-suresi.html", 
  "http://www.kuranikerimmeali.com/fatir-suresi.html", 
  "http://www.kuranikerimmeali.com/meryem-suresi.html", 
  "http://www.kuranikerimmeali.com/taha-suresi.html", 
  "http://www.kuranikerimmeali.com/vakia-suresi.html", 
  "http://www.kuranikerimmeali.com/suara-suresi.html", 
  "http://www.kuranikerimmeali.com/neml-suresi.html", 
  "http://www.kuranikerimmeali.com/kasas-suresi.html", 
  "http://www.kuranikerimmeali.com/isra-suresi.html", 
  "http://www.kuranikerimmeali.com/yunus-suresi.html", 
  "http://www.kuranikerimmeali.com/hud-suresi.html", 
  "http://www.kuranikerimmeali.com/yusuf-suresi.html", 
  "http://www.kuranikerimmeali.com/hicr-suresi.html", 
  "http://www.kuranikerimmeali.com/enam-suresi.html", 
  "http://www.kuranikerimmeali.com/saffat-suresi.html", 
  "http://www.kuranikerimmeali.com/lukman-suresi.html", 
  "http://www.kuranikerimmeali.com/sebe-suresi.html", 
  "http://www.kuranikerimmeali.com/zumer-suresi.html", 
  "http://www.kuranikerimmeali.com/mumin-suresi.html", 
  "http://www.kuranikerimmeali.com/fussilet-suresi.html", 
  "http://www.kuranikerimmeali.com/sura-suresi.html", 
  "http://www.kuranikerimmeali.com/zuhruf-suresi.html", 
  "http://www.kuranikerimmeali.com/duhan-suresi.html", 
  "http://www.kuranikerimmeali.com/casiye-suresi.html", 
  "http://www.kuranikerimmeali.com/ahkaf-suresi.html", 
  "http://www.kuranikerimmeali.com/zariyat-suresi.html", 
  "http://www.kuranikerimmeali.com/gasiye-suresi.html", 
  "http://www.kuranikerimmeali.com/kehf-suresi.html", 
  "http://www.kuranikerimmeali.com/nahl-suresi.html", 
  "http://www.kuranikerimmeali.com/nuh-suresi.html", 
  "http://www.kuranikerimmeali.com/ibrahim-suresi.html", 
  "http://www.kuranikerimmeali.com/enbiya-suresi.html", 
  "http://www.kuranikerimmeali.com/muminun-suresi.html", 
  "http://www.kuranikerimmeali.com/secde-suresi.html", 
  "http://www.kuranikerimmeali.com/tur-suresi.html", 
  "http://www.kuranikerimmeali.com/mulk-suresi.html", 
  "http://www.kuranikerimmeali.com/hakka-suresi.html", 
  "http://www.kuranikerimmeali.com/mearic-suresi.html", 
  "http://www.kuranikerimmeali.com/nebe-suresi.html", 
  "http://www.kuranikerimmeali.com/naziat-suresi.html", 
  "http://www.kuranikerimmeali.com/infitar-suresi.html", 
  "http://www.kuranikerimmeali.com/insikak-suresi.html", 
  "http://www.kuranikerimmeali.com/rum-suresi.html", 
  "http://www.kuranikerimmeali.com/ankebut-suresi.html", 
  "http://www.kuranikerimmeali.com/mutaffifin-suresi.html", 
  "http://www.kuranikerimmeali.com/rad-suresi.html", 
  "http://www.kuranikerimmeali.com/hac-suresi.html", 
  "http://www.kuranikerimmeali.com/rahman-suresi.html", 
  "http://www.kuranikerimmeali.com/insan-suresi.html", 
  "http://www.kuranikerimmeali.com/zilzal-suresi.html", 
  "http://www.kuranikerimmeali.com/bakara-suresi.html", 
  "http://www.kuranikerimmeali.com/enfal-suresi.html", 
  "http://www.kuranikerimmeali.com/ali-imran-suresi.html", 
  "http://www.kuranikerimmeali.com/hasr-suresi.html", 
  "http://www.kuranikerimmeali.com/cumua-suresi.html", 
  "http://www.kuranikerimmeali.com/ahzab-suresi.html", 
  "http://www.kuranikerimmeali.com/nisa-suresi.html", 
  "http://www.kuranikerimmeali.com/muhammed-suresi.html", 
  "http://www.kuranikerimmeali.com/talak-suresi.html", 
  "http://www.kuranikerimmeali.com/beyyine-suresi.html", 
  "http://www.kuranikerimmeali.com/nur-suresi.html", 
  "http://www.kuranikerimmeali.com/munafikun-suresi.html", 
  "http://www.kuranikerimmeali.com/mucadile-suresi.html", 
  "http://www.kuranikerimmeali.com/hucurat-suresi.html", 
  "http://www.kuranikerimmeali.com/tahrim-suresi.html", 
  "http://www.kuranikerimmeali.com/tegabun-suresi.html", 
  "http://www.kuranikerimmeali.com/saff-suresi.html", 
  "http://www.kuranikerimmeali.com/fetih-suresi.html", 
  "http://www.kuranikerimmeali.com/maide-suresi.html", 
  "http://www.kuranikerimmeali.com/mumtehine-suresi.html", 
  "http://www.kuranikerimmeali.com/hadid-suresi.html", 
  "http://www.kuranikerimmeali.com/tevbe-suresi.html", 
  "http://www.kuranikerimmeali.com/nasr-suresi.html"
]

def scrape_sure(url):
  d = pq(url=url)
  text = d('#sure > p').text()

  return re.sub(r"\d{1,3}\.{1}\s+", "", text)

def generate_qoran():
  sures = [scrape_sure(url) for url in sure_links]
  return ' '.join(sures)

def dump_qoran(sures):
  with open('qoran.txt', mode='w', encoding='utf-8') as qoran:
    qoran.write(sures)

sures = generate_qoran()
dump_qoran(sures)