Capturing Screenshots with Browserbear
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? Well let me show you.
Identifying and Targeting Page Elements
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 element 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 are structured their page.
Configuring Browserbear Actions
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.
Running the Automation in Browserbear
Do check out our previous videos or 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 go 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 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.
Browserbear's Versatility for Page Interactions
So there you have it that is how you can interact with the page in fact Browserbear has got hundreds, I don't know hundreds, they've got loads of actions that you can use to interact with the page together just the right place in order to run their automations on the page and send that data into your Bubble app.
Learning Bubble at Planet No Code
If you're learning Bubble there's no better place than planetnocode.com where you can find even more tutorials than on our YouTube channel.