Skip to content

Instantly share code, notes, and snippets.

@yask123
Created September 16, 2015 11:29
Show Gist options
  • Select an option

  • Save yask123/920047058ce1cf07a732 to your computer and use it in GitHub Desktop.

Select an option

Save yask123/920047058ce1cf07a732 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
import urllib2
response=urllib2.urlopen('http://jeequery.com/about/')
html = response.read()
soup = BeautifulSoup(html, 'html.parser')
a = soup.find_all('a')
for each in a:
if str(each).find('facebook.com/') >0 :
print 'Fb link: ',each['href'],
fbresponse = urllib2.urlopen(str(each['href']))
html2 = fbresponse.read()
soup2 = BeautifulSoup(html2, 'html.parser')
name = str(soup2.title.string)
print ' Full Name : ',name[:name.find('|')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment