Get a Free Trial
GrabzIt's Online Community

Capture a Website with JS flip/rotate images

Ask questions relating to GrabzIt's Web Scraper Tool. Such as how to use the web scraper and API to extract data from web pages, images or PDF documents.

There are no forum posts on this topic! Why don't you write one?

Hi,

i wanna capture a Website with JS flip/rotate images.

Chromium block the autostart of the javascript.

Unfortunately, grabz also seems to block autorotation and only captures the first picture.

Is there any solution for this problemn?

regards - Helge

Asked by anonymous on the 18th of April 2024

Did you try adding a delay? That should allow other images to load before the screenshot is taken. Converting the web page to a video should show all the images if captured through the screenshot tool.

What web page are you trying to capture?

Answered by GrabzIt Support on the 18th of April 2024

Hi many thanks for the fast response,

i try to capture a video from here:

https://mediauploads.dooh.de/programmatic/e732d11b-c3f8-4637-97af-367896b8f7ca/index.html

the captured video should be 30s long, the time for a complete rotation.

But it takes only 10s. (fixed this by setting duration to 30)

This is my request:

https://api.grabz.it/services/convert?key=##mykey###&click=img&format=mp4&url=https://mediauploads.dooh.de/programmatic/e732d11b-c3f8-4637-97af-367896b8f7ca/index.html

regards - Helge

Answered by anonymous on the 18th of April 2024

Hi Helge,

You need to set the duration to 30: https://grabz.it/api/rest/#video-url_input

Answered by GrabzIt Support on the 18th of April 2024

Hi,

it still captured only the first image :-(

 

regards Helge

Answered by anonymous on the 18th of April 2024

Hi Helge,

We have released a fix that starts capturing the video sooner. It now captures all the images. 

Answered by GrabzIt Support on the 18th of April 2024

Hello,

now it works!

Many thanks!

Best Regards - Helge

Answered by anonymous on the 19th of April 2024

Glad it's working!

Answered by GrabzIt Support on the 19th of April 2024

Hey,

i hope this is the last question :)

I try to store the result of the converted video to a ftp connection.

I have added a FTP connnection to my account and after that i try to store the capture to the secured link:

so i added => &export=grabzit://66223456f925e9fc8583dde4

via postman. It throws an error 168 back:

{
    "Result": "False",
    "ID": "",
    "Message": "Invalid format for export URL.",
    "Code": "168"
}

i tried both the Secure and the Actual Export URL.

Any Idear?

PS this link:

https://cdn.grabzit.com/api/aspnet/aspnet.3.5.6.zip

to download the aspnet code throws an 403 Error for me

 

Answered by anonymous on the 19th of April 2024

I think I can see what the issue is. It should be in the format:

export=grabzit%3A%2F%2F615ef7e369b1f6df7aa9b478%40my.domain.com

Examples can be found here: https://grabz.it/support/article/export-capture/

Answered by GrabzIt Support on the 19th of April 2024

Hi,

even when i escaped the specil chars:

https://api.grabz.it/services/convert?key=##MyKey##&click=img&format=mp4&url=https://mediauploads.dooh.de/programmatic/e732d11b-c3f8-4637-97af-367896b8f7ca/index.html&duration=10&waitfor =div:nth-child(1)&export=grabzit%3A%2F%2F615ef7e369b1f6df7aa9b478%40beta.dooh.eu

the same error response:

{
    "Result": "False",
    "ID": "",
    "Message": "Invalid format for export URL.",
    "Code": "168"
}

 

regards - Helge

Answered by anonymous on the 19th of April 2024

Please can you try it again. It now checks for invalid secure urls and shows a seperate error message.

Answered by GrabzIt Support on the 19th of April 2024

I tried both:

 

https://api.grabz.it/services/convert?key=##MyKey##&click=img&format=mp4&url=https://mediauploads.dooh.de/programmatic/e732d11b-c3f8-4637-97af-367896b8f7ca/index.html&duration=10&waitfor =div:nth-child(1)&export=grabzit%3A%2F%2F615ef7e369b1f6df7aa9b478%40beta.dooh.eu%2F&height=Maximum&width=Maximum

https://api.grabz.it/services/convert?key=##MyKey##&click=img&format=mp4&url=https://mediauploads.dooh.de/programmatic/e732d11b-c3f8-4637-97af-367896b8f7ca/index.html&duration=10&waitfor =div:nth-child(1)&export=ftp%3A%2F%2FgrabzBeta%3A##MyFtpPassword##%40beta.dooh.eu&height=Maximum&width=Maximum

 

Postman shows no Error - but there is no traffic/files on the FTP Account

Anothe Question:

Can i set the width&height Params?

I tried Maximun, -1 and 1080 for the width (1920 for Height)

Ist there an example? i've only found this:

height - the height of the resulting thumbnail in pixelsDefault: if both the output width and output height are not specified or 0 then the output width and height will match the final image width and height, if the output width is specified the output height will be proportional to the output width
Maximum: Maximum height for package
Full Height: -1 (passing -1 means that the height of the thumbnail is not reduced)

Ah i just see i use the wrong params - forget these, sorry.

Still the problem obove and the Error 403 on the ASP Download Page :)

Answered by anonymous on the 19th of April 2024

With the Video API it is a video of the browser, so you must set the browser width and height. We are looking into the upload issue.

Answered by GrabzIt Support on the 19th of April 2024

The 403 error is fixed, we recently locked down our recourse on our CDN. Thanks for telling us.

Regarding the upload, I think it might be a FTP server issue. We just tried it with https://sftpcloud.io/tools/free-ftp-server and it worked correctly.

Are you sure you haven't got any restrictions? Note this is FTP not SFTP.

 

Answered by GrabzIt Support on the 19th of April 2024

Ah, ok... i only allow TLS on my FTP i think.

I look on the .NET Solution now, many thanks for your support.

By the way -> the API ignores my bwith & bheight 

i want to capture the Side in 1080 width and 1920 height... i tried som different values but the video ist always 1366x1170 (The Default Value)

Best regards

Answered by anonymous on the 19th of April 2024

Ok, we have a released a fix for the browser width and height issue it should be live by about 17:30 UTC.

Answered by GrabzIt Support on the 19th of April 2024

Hi, 

now setting browser height/width works fine - thank you.

Is there a way to get the captured Video as Stream?

I've found nothing in the .NET Solution about this?

Regards - Helge

Answered by anonymous on the 23rd of April 2024

Great.

No theres not but heres the code: https://github.com/GrabzIt/grabzit/blob/d770e690d2c5e3e3d8160cdb745745f04c04c1f6/aspnet/GrabzIt/GrabzItClient.cs#L1435

The problem is if you returned a stream it would be closed once the HttpWebResponse is disposed of, which would happen immediatley. Which is why the GrabzItFile is returned which has already read the value with a stream.

What might be possible is to have a method such as WriteResultToStream which accepts the ID and a stream and writes to the supplied stream. Is this acceptable?

Answered by GrabzIt Support on the 23rd of April 2024

If you update the ASP.NET library the WriteResultToStream method is now available.

Answered by GrabzIt Support on the 23rd of April 2024