Skip to content

Instantly share code, notes, and snippets.

@itanium21
Last active July 12, 2016 15:45
Show Gist options
  • Save itanium21/06de3a3499332cdcf83ec6b5d484e31b to your computer and use it in GitHub Desktop.
Save itanium21/06de3a3499332cdcf83ec6b5d484e31b to your computer and use it in GitHub Desktop.
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="")
@itanium21
Copy link
Author

sys.argv[1]:
#M1 = 60
#M5 = 300
#M15 = 900
#M30 = 1800
#H1 = 3600
#H5 = 18000
#D = 86400
#W = week
#M = month

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment