Skip to content

Commit de04908

Browse files
committed
Sezer hocanın sitesini parse ettik.
1 parent 7130d32 commit de04908

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Beautiful-Soup/parse_sezer.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from bs4 import BeautifulSoup
2+
import requests
3+
import json
4+
5+
r = requests.get("http://sezerbozkir.com/")
6+
soup = BeautifulSoup(r.text, "html.parser")
7+
8+
liste = []
9+
10+
articles = soup.find_all("article")
11+
for art in articles:
12+
liste.append(art.header.h1.a.string)
13+
14+
with open("sezer.json", "w", encoding="utf-8") as f:
15+
json.dump(liste, f, ensure_ascii=False)
16+
print("Dosya yazma başarılı.")

Beautiful-Soup/sezer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
["Saf Python ile Veri Kazıma (Web Scraping)", "Yerel Ortamdaki Siteyi İnternete Çıkarma", "Kendine Meydan Okuyan Adam", "MacOSX’de Çoklu Python Sürümleri ile Çalışmak", "Motosiklet Edinme Süreci", "Map, Filter, Reduce Kavramları", "Swagger ile Restful API Dökümanı Oluşturma", "Motosiklet Aldım !", "Fonksiyon Deseni ile Hata Yakalama", "Python’da detaylı hata analizi"]

0 commit comments

Comments
 (0)