@@ -35,27 +35,23 @@ class Backend:
3535
3636 timeout = 60
3737
38- def __init__ (self , searchquery , outputformat , messageshowingfunc , outputpath ):
38+ def __init__ (self , searchquery , outputformat , messageshowingfunc , outputpath , healdessmode ):
3939 """
4040 params:
4141
4242 search query: it is the value that user will enter in search query entry
4343 outputformat: output format of file , selected by user
4444 messageshowingfunc: function refernece to function of frontend class to
4545 outputpath: directory path where file will be stored after scraping
46+ headlessmode: it's value can be 0 and 1, 0 means unchecked box and 1 means checked
4647
4748 """
4849
4950
5051 self .searchquery = searchquery # search query that user will enter
5152 self .messageshowing = messageshowingfunc # it is a function used as api for transfering message form this backend to frontend
5253
53- """
54- output path is location of folder where file will be stored after scraping.
55- it will be asked When user will use this application for first time, after that
56- user can change this path by clicking on the button "Reset path"
57- """
58-
54+ self .headlessMode = healdessmode
5955 self .datasaver = DataSaver (
6056 selectedpath = outputpath ,
6157 outputformat = outputformat ,
@@ -197,6 +193,10 @@ def mainscraping(self):
197193 """Starting our browser"""
198194
199195 options = uc .ChromeOptions ()
196+
197+ if self .headlessMode == 1 :
198+ options .headless = True
199+
200200 prefs = {"profile.managed_default_content_settings.images" : 2 }
201201 options .add_experimental_option ("prefs" , prefs )
202202
0 commit comments