Skip to content

Instantly share code, notes, and snippets.

@muhfaris
Created December 9, 2016 01:48
Show Gist options
  • Save muhfaris/e23b7589972b1281cbc467ea96dc2cbc to your computer and use it in GitHub Desktop.
Save muhfaris/e23b7589972b1281cbc467ea96dc2cbc to your computer and use it in GitHub Desktop.
scrape debugger facebook, open url link
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