Skip to content

Commit 0ccb898

Browse files
Installing dependencies automatically
1 parent 904a05b commit 0ccb898

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
# -*- coding: utf-8 -*-
2+
3+
def install(package):
4+
import importlib
5+
try:
6+
importlib.import_module(package)
7+
except ImportError:
8+
import pip
9+
pip.main(['install', package])
10+
install('requests')
11+
install('bs4')
12+
install('urllib2')
13+
install('cookielib')
14+
install('getpass')
15+
216
import requests
317
from bs4 import BeautifulSoup
418
from custom_exceptions import *

0 commit comments

Comments
 (0)