webscreenshot icon indicating copy to clipboard operation
webscreenshot copied to clipboard

Domain does not gets formatted automatically due to which command fails

Open 0cirius0 opened this issue 5 years ago • 2 comments

I tried to execute it from within a python code but it kept failing. I tried took the DEBUG output and matched it wih when the command is run directly from shell. I tcame out to be that when I provide a list of domains from within another python code then the domains aren't being converted from google.com to http://google.com:80 due to which the command fails.

Screenshot when ran inside python Screenshot from 2020-12-15 19-23-54

Screenshot when ran directly Screenshot from 2020-12-15 19-24-52

0cirius0 avatar Dec 15 '20 13:12 0cirius0

Hello @hellrider9,

It fails because the list of targets you pass (through lines variable) is not properly parsed and formatted. You should pass lines like http://google.com and not google.com :

  • Look at the url_list items' format in the sample code
  • When you run through CLI, the inputs are first parsed with this function, that explains why it is successful in your case https://github.com/maaaaz/webscreenshot/blob/16e5c2a7448a9cb3248074de287c30a86c6974b6/webscreenshot.py#L639

In a next release, I will upgrade the parse_targets function to be able to accept to parse a programmatic list as parameter, not only the options parameter, and then update the wiki. Basically after this change:

  • This url_list = ['http://google.fr', 'http://google.com']
  • Will then become url_list = parse_targets(custom_list=['http://google.fr', 'http://google.com'])

Cheers.

maaaaz avatar Dec 15 '20 21:12 maaaaz

Thanks.

Just for the heads up, when can I expect then next release.

0cirius0 avatar Dec 16 '20 15:12 0cirius0