Closed youngblood closed 4 years ago
The load_css
, load_js
and load_images
arguments are only accepted in the api functions
save_webpage
and save_website
.
If you manually want to see the implementation then go here:
Yes there shouldn't be a config circular implementation, it should be refactored in the next release.
That makes sense. Is it true that setting pywebcopy.config['allowed_file_ext']
directly should work for both the API and the WebPage class? Is there a more preferred way to set those restrictions when working with the WebPage class? Thanks!
Yes. Setting the pywebcopy.config['allowed_file_ext']
directly should work for both the API and the WebPage class
I am closing it as it is resolved.
Using the
load_css
,load_images
, andload_javascript
arguments forconfig.setup_config()
andsave_webpage()
doesn't seem to restrict the types of files downloaded. UsingFalse
for all still resulted in css, image, an javascript files downloaded.That said, they do appear to have some effect. When I set those arguments to
False
usingconfig.setup_config()
they seem to have no effect, and the below code still hangs when saving the first URL in the list. But when I also pass those parameters to the save_webpage() function, it still downloads all those filetypes (so doesn't work as I would expect) but it does cause the program to run to completion. Unclear why passing those arguments directly to save_webpage() is allowing the program to finish.Next, I tried to set the
allowed_file_ext
argument for bothconfig.setup_config()
andsave_webpage()
but neither accepts that argument.So finally I directly set
config['allowed_file_ext'] = ['.html','.css','svg','.js','.jpg','.png','.htm','jpeg']
and that did seem to restrict the file types downloaded for the most part, although it is still downloading some other types like '.pwc'.Code: