Advertisement
python_notes

Example RegEx for IPs and Request Module Usage

Jul 31st, 2014
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. #!/bin/python
  2.  
  3. import requests
  4. import re
  5.  
  6. page = requests.get('http://sherdog.com')
  7. ans = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', page.text)
  8.  
  9. for each in ans:
  10.     print each
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement