12345678910111213141516171819202122 |
- #!/usr/bin/python3
- from bs4 import BeautifulSoup;
- import requests;
- import urllib;
- import re;
- rapciDosyasi = open('rapciler.txt','r');
- sarki = open('sarkilar.txt', 'a');
- rapci = rapciDosyasi.readlines();
- for i in range(0, len(rapci)):
- url = rapci[i];
- kaynak = requests.get(url);
- icerik = kaynak.content;
- crawler = BeautifulSoup(icerik,"html.parser");
- for a in crawler.find('div', {"class" : "listing wide icon"}).find_all('a', href=True):
- sarki.write(a['href']);
- sarki.write('\n');
- print (i, "yazıldı.");
- sarki.close();
|