Nis 092015
 
3.974 viewsPython Requests ve BeautifulSoup paketleri

Python Requests ve BeautifulSoup paketleri [youtube https://www.youtube.com/watch?v=r7__TtkGKbE&w=560&h=315] Bu kez kodların açıklamalarına girmiyorum. Videoda yeterince ayrıntı mevcut. Kullandığım kodlar da aşağıda mevcut. # -*- coding: utf-8 -*- import requests from bs4 import BeautifulSoup headers = { “user-agent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)”, “accept”: “text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8″, “accept-charset”: “cp1254,ISO-8859-9,utf-8;q=0.7,*;q=0.3”, “accept-encoding”: “gzip,deflate,sdch”, “accept-language”: “tr,tr-TR,en-US,en;q=0.8”, } def haber_oku(haber_url): r = requests.get(haber_url, headers=headers) if r.status_code != 200: return soup = […]