Limited Time Offer: Watch All Our Bubble Tutorial Videos for Only $99 per Year!

API screenshots without popups with Browserbear

In this Bubble tutorial we demonstrate how to take better screenshots with the Browserbear API by removing modals/popups from the from page of the New York Times.

This is a quick part two to my video where I was demonstrating how you can use BrowserBear to screenshot the homepage of the New York Times. And one of the frustrations I found was that we get this modal or pop-up appearing and I want to be able to click continue on this to dismiss it in order to get a nice clean screenshot. Otherwise the whole page appears with one... Yeah, it looks terrible. So how have I found a way to do that?

Find the button ID/Class

Well, let me show you. I right-click, I'm in a Chromium browser, and I just need to find the class for this element. So I'm going to copy the class here and then in BrowserBear I've added in these additional two steps between my go action and my take screenshot and that is to say click. And so I'm saying click on the elements on the page that has this class ID. Now this is going to really vary depending on what websites you use, how they're coded. You might have to use the ID. In this case I'm using class because that's just what I thought would make the most sense with how the New York Times has structured their page. Anyway, you might need to be a bit more flexible with this but I'm saying target this element and then just for good measure I'm saying wait in case there's some sort of fade out animation with dismissing the modal and then I'm finally saying take screenshot.


Now let me show you what I get as a result and I'm going to run this in the BrowserBear dashboard but of course you could be running this through the Bubble API connector. Do check out our previous videos about BrowserBear for how we've got it running through the Bubble API connector. But let's run the task and we can see that it's running here. I'm going to click on log and then I'm going to wait for it to complete. Okay, it's completed and I'm going to scroll down and this is the JSON that will be returned to the Bubble app if you provide your Bubble webhook and I'm going to click on the screenshot media link here and you can now see that my New York Times homepage does not contain the terms pop-up.

Wrap up

So there you have it. That is how you can interact with a page. In fact, BrowserBear has got hundreds they've got loads of actions that you can use to interact with the page to get just the right place in order to run their automations on the page and send that data into your Bubble app. If you're learning Bubble there's no better place than where you can find even more tutorials than on our YouTube

Latest videos