Last active
July 12, 2016 15:45
-
-
Save itanium21/06de3a3499332cdcf83ec6b5d484e31b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import urllib.request | |
import sys | |
period = sys.argv[1] | |
class AppURLopener(urllib.request.FancyURLopener): | |
version = "Mozilla/5.0" | |
opener = AppURLopener() | |
response = opener.open("http://m.investing.com/currencies/eur-usd-technical?period=" + str(period)) | |
soup = BeautifulSoup(response, 'html.parser') | |
print(soup.find("td", class_="coloredBoxTD").contents[1].string, end="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sys.argv[1]:
#M1 = 60
#M5 = 300
#M15 = 900
#M30 = 1800
#H1 = 3600
#H5 = 18000
#D = 86400
#W = week
#M = month