Created
December 9, 2016 01:48
-
-
Save muhfaris/e23b7589972b1281cbc467ea96dc2cbc to your computer and use it in GitHub Desktop.
scrape debugger facebook, open url link
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
import subprocess | |
import webbrowser | |
import sys | |
from socket import error as SocketError | |
import urllib | |
import errno | |
import time | |
with open('/mnt/Data/temp/test_manual/temp_links_2.txt','r') as infile: | |
data = infile.read() | |
listme = data.splitlines() | |
try: | |
for line in listme: | |
url = 'https://developers.facebook.com/tools/debug/og/object?q='+line+'&scrape=true' | |
chrome = '/usr/bin/firefox' | |
webbrowser.get(chrome).open(url) | |
print line | |
time.sleep(30) | |
except SocketError as e: | |
if e.errno != errno.ECONNRESET: | |
raise #Not error we are looking for | |
pass #Handle error her |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment