Skip to content

Commit

Permalink
Merge pull request #44 from nateshmbhat/proxy-add
Browse files Browse the repository at this point in the history
added option to specify a proxy server
  • Loading branch information
nateshmbhat authored Aug 2, 2020
2 parents bec282a + 23a2536 commit e0c39d8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import platform
from setuptools import setup

VERSION="0.21"
VERSION="0.33"

with open('README.rst' , 'r' , encoding='utf-8') as f:
long_description = f.read()
Expand All @@ -17,7 +17,7 @@
author = 'Natesh M Bhat' ,
url = 'https://github.com/nateshmbhat/webbot',
author_email = '[email protected]' ,
keywords=['webbot', 'selenium' , 'autoweb','automate' , 'automation' ,'web' , 'autoweb' , 'auto' , 'pyauto', 'pyautogui'],
keywords=['webbot', 'selenium' , 'autoweb','automate' , 'automation','pyttsx3','bs4' , 'beautiful soup' ,'web' , 'autoweb' , 'auto' , 'pyauto', 'pyautogui'],
classifiers = [
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
Expand Down
Empty file modified webbot/drivers/chrome_mac
100644 → 100755
Empty file.
10 changes: 8 additions & 2 deletions webbot/webbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ class Browser:
**Constructor**
:__init__(showWindow = True):
:__init__(showWindow = True , proxy = None):
The constructor takes showWindow flag as argument which Defaults to False. If it is set to true , all browser happen without showing up any GUI window .
:Args:
- showWindow : If true , will run a headless browser without showing GUI window.
- proxy : Url of any optional proxy server.
Object attributes: Key , errors
Expand All @@ -31,10 +35,12 @@ class Browser:
'''

def __init__(self , showWindow = True ):
def __init__(self , showWindow = True , proxy = None ):
options = webdriver.ChromeOptions()
options.add_argument("--disable-dev-shm-usage") ;
options.add_argument("--no-sandbox") ;
if(proxy is not None and isinstance(proxy , str)):
options.add_argument("--proxy-server={}".format(proxy)) ;

if(not showWindow):
options.set_headless(headless=True) ;
Expand Down

0 comments on commit e0c39d8

Please sign in to comment.