Created
September 15, 2017 16:43
-
-
Save heywoodlh/b2d6c1e8748f6cc0c3da9e593111ebac to your computer and use it in GitHub Desktop.
Facebook Search
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import sys | |
| import requests | |
| from bs4 import BeautifulSoup as bs | |
| try: | |
| firstname = sys.argv[1] | |
| except IndexError: | |
| print('Usage: ' + sys.argv[0] + ' firstname lastname') | |
| sys.exit(1) | |
| try: | |
| lastname = sys.argv[2] | |
| except IndexError: | |
| pass | |
| try: | |
| query_string = 'https://www.facebook.com/public?query=' + firstname + '+' + lastname + '&init=ffs&nomc=0' | |
| except NameError: | |
| query_string = 'https://www.facebook.com/public?query=' + firstname + '&init=ffs&nomc=0' | |
| r = requests.get(query_string) | |
| content = r.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment