Skip to content

Instantly share code, notes, and snippets.

@danlamanna
Created March 7, 2015 18:20
Show Gist options
  • Save danlamanna/b3c783f16bbdd663c5ac to your computer and use it in GitHub Desktop.
Save danlamanna/b3c783f16bbdd663c5ac to your computer and use it in GitHub Desktop.
import urllib, sys
from bs4 import BeautifulSoup
page = urllib.urlopen("https://ualbanydining.com/dining-choices/resident/indian.html")
soup = BeautifulSoup(page.read())
links = soup.select("#accordion_4736 ul li a")
if not links:
print "Couldn't find link.."
sys.exit(1)
else:
print links[0].attrs["href"]
@El-Coder
Copy link

Test comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment