Advertisement
MertcanGokgoz

Untitled

Dec 30th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. # /usr/bin/python3.4
  2. # -*- coding: utf-8 -*-
  3. __author__ = 'Mertcan Gökgöz'
  4.  
  5. from bs4 import BeautifulSoup
  6. from urllib.request import urlopen, Request
  7.  
  8.  
  9. def DolarParse():
  10.     pasteURL = "http://tr.investing.com/currencies/usd-try"
  11.     data = urlopen(Request(pasteURL, headers={'User-Agent': 'Mozilla'})).read()
  12.     parse = BeautifulSoup(data)
  13.     for dolar in parse.find_all('span', id="last_last"):
  14.         liste = list(dolar)
  15.         print("Güncel Dolar Kuru: " + str(liste))
  16.  
  17.  
  18. def EuroParse():
  19.     pasteURL = "http://tr.investing.com/currencies/eur-try"
  20.     data = urlopen(Request(pasteURL, headers={'User-Agent': 'Mozilla'})).read()
  21.     parse = BeautifulSoup(data)
  22.     for dolar in parse.find_all('span', id="last_last"):
  23.         liste = list(dolar)
  24.         print("Güncel Euro Kuru: " + str(liste))
  25.  
  26.  
  27. DolarParse()
  28. EuroParse()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement