SBCODEZCAPER.py


SUBMITTED BY: Guest

DATE: Oct. 4, 2014, 7:58 a.m.

FORMAT: Text only

SIZE: 674 Bytes

HITS: 1188

  1. #!/usr/bin env/python
  2. # Connect to http site using python-requests
  3. # Fetch current posted swagcode and worth from site
  4. # Print swagcodes on screen and worth
  5. from lxml import html
  6. import requests
  7. print 'SBCODEZCAPER.py by SCAREDKID.org - http://scaredkid.org\n'
  8. print 'Donate Dogecoin?\n'
  9. print 'DJhw7i3z7FMpPEN5bMKNXMuxpyeQy9LEY1\n'
  10. page = requests.get('http://sbcodez.com/')
  11. tree = html.fromstring(page.text)
  12. # Get code?
  13. code = tree.xpath('//span[@class="code"]/text()')
  14. # Get worth?
  15. worth = tree.xpath('//span[@class="codeWorth"]/text()')
  16. print 'Codes:', code
  17. print 'Worth:', worth
  18. #EOF

comments powered by Disqus