Untitled


SUBMITTED BY: Guest

DATE: Oct. 4, 2014, 8:02 a.m.

FORMAT: Text only

SIZE: 734 Bytes

HITS: 1383

  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 crypro?\n'
  9. print 'Doge: DJhw7i3z7FMpPEN5bMKNXMuxpyeQy9LEY1\n'
  10. print 'BTC: 1JmS81r4n11WmfUUKJfKUfp7Weym6p7iqN\n'
  11. page = requests.get('http://sbcodez.com/')
  12. tree = html.fromstring(page.text)
  13. # Get code?
  14. code = tree.xpath('//span[@class="code"]/text()')
  15. # Get worth?
  16. worth = tree.xpath('//span[@class="codeWorth"]/text()')
  17. print 'Codes:', code
  18. print 'Worth:', worth
  19. #EOF

comments powered by Disqus