vgalin / html2image

A package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.
MIT License
354 stars 43 forks source link

Broken on 3.7.x #127

Open egh opened 1 year ago

egh commented 1 year ago
../../.cache/pypoetry/virtualenvs/framey-KJJC3bmX-py3.7/lib/python3.7/site-packages/html2image/html2image.py:16: in <module>
    from html2image.browsers import chrome, chrome_cdp, edge  # , firefox, firefox_cdp
E     File "<fstring>", line 1
E       (r.json()=)
E                ^
E   SyntaxError: invalid syntax
pxpwoa commented 1 year ago

in centos system comment code about "chrome_cdp, edge" of html2image.py works for me:


from html2image.browsers import chrome # , chrome_cdp, edge  # , firefox, firefox_cdp

browser_map = {
    'chrome': chrome.ChromeHeadless,
    'chromium': chrome.ChromeHeadless,
    'google-chrome': chrome.ChromeHeadless,
    'googlechrome': chrome.ChromeHeadless,
    # 'edge': edge.EdgeHeadless,
    # 'chrome-cdp': chrome_cdp.ChromeCDP,
    # 'chromium-cdp': chrome_cdp.ChromeCDP,
    # 'firefox': firefox.FirefoxHeadless,
    # 'mozilla-firefox': firefox.FirefoxHeadless,
    # 'firefox-cdp': firefox_cdp.FirefoxCDP,
}