Forked from danlamanna/gist:b3c783f16bbdd663c5ac
Last active
August 14, 2018 00:43
-
-
Save El-Coder/51542253c55a437bafef to your computer and use it in GitHub Desktop.
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 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"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment