Skip to content

Instantly share code, notes, and snippets.

@alyakhtar
Created March 3, 2017 01:12
Show Gist options
  • Save alyakhtar/4ea434604e01eaddad64ba40b261395c to your computer and use it in GitHub Desktop.
Save alyakhtar/4ea434604e01eaddad64ba40b261395c to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
import requests
import webbrowser
from tabulate import tabulate
mylist = {}
source_code = requests.get('http://www.intern.supply/')
plain_text = source_code.text
soup = BeautifulSoup(plain_text, "lxml")
for i in soup.findAll('article',{'class':'item 4u 12u$(mobile)'}):
link = i.find('a')
if link is not None:
green = i.find('i',{'class':'fa fa-circle card-circle open'})
if green is not None:
name = i.find('div')
if 'card-open' in name.get('class'):
mylist[name.text.strip('\n')] = link.get('href')
link = ''
a = []
for j in mylist:
a.append([j,mylist[j]])
print tabulate(a)
# for i,x in mylist.iteritems():
# webbrowser.open_new_tab(x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment