Created
January 4, 2019 13:29
-
-
Save p208p2002/025a7adb7b07bb048a197099dcc89cb3 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
| def getBsObj(url): | |
| try: | |
| html=urlopen(url) | |
| except: | |
| print('open url fail') | |
| return 1 | |
| try: | |
| bsObj=BeautifulSoup(html.read(),'html.parser') | |
| except: | |
| print('html parser fail') | |
| return 1 | |
| return bsObj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment