maaaaz / webscreenshot

A simple script to screenshot a list of websites
GNU Lesser General Public License v3.0
653 stars 162 forks source link

Shell command PID XXXXX returned an abnormal error code: '-11' #58

Closed aldricmp closed 3 years ago

aldricmp commented 3 years ago

Hi, I'm getting this error on this specific url It does create the screenshot ok but the error appears. Screenshots on other links in the same domain seem to work ok.

urls.txt: http://www.milenio.com/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza

Command used: webscreenshot -vv -i urls.txt -o news_extractor/static/screenshots --ajax-max-timeouts 2500,2500

Output:

webscreenshot.py version 2.94

[DEBUG][General] Options: Namespace(URL=None, ajax_max_timeouts='2500,2500', cookie=None, crop=None, custom_js=None, format='png', header=None, http_password=None, http_username=None, imagemagick_binary=None, input_file='urls.txt', label=False, label_bg_color='NavajoWhite', label_size=60, log_level='DEBUG', multiprotocol=False, no_error_file=False, no_xserver=False, output_directory='/Users/aldricmp1/PycharmProjects/newsextractorapp/news_extractor/static/screenshots', port=None, proxy=None, proxy_auth=None, proxy_type=None, quality=75, renderer='phantomjs', renderer_binary=None, single_output_file=None, ssl=False, timeout=30, verbosity=2, window_size='1200,800', workers=4)

[INFO][General] 'http://www.milenio.com/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza' has been formatted as 'http://www.milenio.com:80/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza' with supplied overriding options [+] 1 URLs to be screenshot [DEBUG][http://www.milenio.com:80/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza] Shell command to be executed 'phantomjs --ignore-ssl-errors=true --ssl-protocol=any --ssl-ciphers=ALL "/Users/aldricmp1/opt/anaconda3/envs/newsextractorapp/lib/python3.6/site-packages/webscreenshot/webscreenshot.js" url_capture=http://www.milenio.com:80/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza output_file="/Users/aldricmp1/PycharmProjects/newsextractorapp/news_extractor/static/screenshots/http_www.milenio.com_80_politica_lopez-gatell-habra-hospitales-llenos-por-epoca-influenza.png" width=1200 height=800 format=png quality=75 ajaxtimeout=2500 maxtimeout=2500'

[ERROR][http://www.milenio.com:80/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza] Shell command PID 91585 returned an abnormal error code: '-11' [ERROR][http://www.milenio.com:80/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza] Screenshot somehow failed

[+] 0 actual URLs screenshot [+] 1 error(s) http://www.milenio.com:80/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza

maaaaz commented 3 years ago

Hello, Could you try this command (adding the debug option to phantomjs) :

phantomjs --debug=true --ignore-ssl-errors=true --ssl-protocol=any --ssl-ciphers=ALL "/Users/aldricmp1/opt/anaconda3/envs/newsextractorapp/lib/python3.6/site-packages/webscreenshot/webscreenshot.js" url_capture=http://www.milenio.com:80/politica/lopez-gatell-habra-hospitales-llenos-por-epoca-influenza output_file="/Users/aldricmp1/PycharmProjects/newsextractorapp/news_extractor/static/screenshots/http_www.milenio.com_80_politica_lopez-gatell-habra-hospitales-llenos-por-epoca-influenza.png" width=1200 height=800 format=png quality=75 ajaxtimeout=2500 maxtimeout=2500
aldricmp commented 3 years ago

Hi, Sure!

Output (just the last part, full output on txt file): 2020-09-24T14:55:47 [DEBUG] WebPage - updateLoadingProgress: 100 2020-09-24T14:55:47 [DEBUG] WebPage - setupFrame "" 2020-09-24T14:55:50 [DEBUG] WebPage - evaluateJavaScript "(function() { return (function () {\r\n\t\t\tdocument.body.bgColor = 'white';\r\n\t\t})(); })()" 2020-09-24T14:55:50 [DEBUG] WebPage - evaluateJavaScript result QVariant(Invalid) PhantomJS has crashed. Please read the bug reporting guide at

output.txt

maaaaz commented 3 years ago

Well, it seems that this page makes phantomjs crash, so I can't do anything special, it's not related to webscreenshot.

Try to use another renderer (for instance, chrome or chromium) to see if you have the behaviour.

aldricmp commented 3 years ago

Will try other renderers Thank You!