The GrabzIt Python Screenshot API provides the ability to take screenshots of mobile versions of websites, however not all websites have special mobile versions and so it may not work in all circumstances. Mobile screenshot can be requested for both image and PDF screenshots as well as when extracting tables.
ਅਜਿਹਾ ਕਰਨ ਲਈ ਤੁਹਾਨੂੰ 1 ਪਾਸ ਪਾਸ ਕਰਨ ਦੀ ਜ਼ਰੂਰਤ ਹੈ setRequestAs
ਜਦੋਂ ਇੱਕ ਬਣਾਉਣ ਵੇਲੇ ਚੋਣਾਂ ਆਬਜੈਕਟ ਦਾ ਗੁਣ ਚਿੱਤਰ ਨੂੰ, PDF or ਸਾਰਣੀ ਵਿੱਚ, ਜਿਵੇਂ ਕਿ ਹੇਠਾਂ ਦਰਸਾਇਆ ਗਿਆ ਹੈ. ਇਹ ਫਿਰ ਟੀਚੇ ਦੀ ਵੈਬਸਾਈਟ ਦੇ ਮੋਬਾਈਲ ਸੰਸਕਰਣ ਦੀ ਬੇਨਤੀ ਕਰੇਗਾ.
ਵਧੇਰੇ ਪ੍ਰਮਾਣਿਤ ਮੋਬਾਈਲ ਸਕ੍ਰੀਨਸ਼ਾਟ ਪ੍ਰਾਪਤ ਕਰਨ ਲਈ, ਇੱਕ ਮਿਆਰੀ ਮੋਬਾਈਲ ਬਰਾ browserਜ਼ਰ ਨੂੰ ਚੌੜਾਈ ਨੂੰ ਪਾਸ ਕਰਨਾ ਇੱਕ ਚੰਗਾ ਵਿਚਾਰ ਹੈ browserWidth
ਦਾ ਗੁਣ GrabzItImageOptions ਕਲਾਸ. ਜਾਂ ਜੇ ਤੁਸੀਂ ਪੀਡੀਐਫ ਤਿਆਰ ਕਰ ਰਹੇ ਹੋ ਤਾਂ ਇੱਕ ਛੋਟੇ ਪੇਜ ਦੇ ਆਕਾਰ ਦੀ ਚੋਣ ਕਰੋ.
from GrabzIt import GrabzItClient from GrabzIt import GrabzItImageOptions options = GrabzItImageOptions.GrabzItImageOptions() options.format = "png" options.browserWidth = 320 options.width = 256 options.height = 256 options.requestAs = 1 grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret") grabzIt.URLToImage("https://www.tesla.com", options) grabzIt.Save("http://www.mysite.com/handler.py")