How to get Linkedin post as taking screenschoots continually || Related: taking screenshoot the specific area

Hello everyone,
I want to get someones’ or companies’ post from Linkedin by taking screenshot. I tried many ways:
I got screenshot of a post by taking screenshot of specific area. But I got specific area of "one"post. I want to take other posts also. How can i make it permanent ?

My question is:
how to take screenshots of linkedin posts continually ?

Hi @TAHA_YASIN_EREL

Interesting. One thing you can try is to go to their posts by navigating to the person profile and then to activity and then click on posts. Now there you have an option to copy post link, spy that element and get the link

Now get the link using attributes and use that link to open the post then take a screnshot

Repeat by identifying a selector for copy link which can be used in combination with idx so that idx can be incremented and each post url can be taken

cheers

I’ll apply and let you know about result

1 Like

While I am checking your advice, could you please take a look at that: Scraping linkedin post from a certain profile
does it make sense on my project?

Hi @TAHA_YASIN_EREL

The suggestion looks good…but yea if you are able to open that xaml you can try… but yea the idea to get is similar…thats how it can be acheived…

Cheers

1 Like

Use the Get Position activity to get the clipping region for the post and then pass that info to Take Screenshot.

1 Like

But position of every post is not same. Some of them taller or shorter. How can I get/find fixed size?

That’s what the Get Position activity does. It gets the position of the UI Element you designate. So you need to get the position of the current post before taking the screenshot.

you are absolutely right but can i get the location of each post? I will try!

Hi @TAHA_YASIN_EREL

If you have each individual posts (by url)then you will have the corresponding selectors to use get position

Cheers

1 Like

If there are multiple posts on a page, then you can use For Each UI Element to loop through all the posts.

1 Like


image

image

Properties of Get Position:
image

Expression that outputs top, left, right, and bottom in logs:

"Post position (T/L/R/B) " + CurrentElementRectangle.Top.ToString + “/” + CurrentElementRectangle.Left.ToString + “/” + CurrentElementRectangle.Right.ToString + “/” + CurrentElementRectangle.Bottom.ToString

image

Test.xaml (17.8 KB)

NOTE: There are a lot of extra variables in that xaml file, sorry about that. It’s a scratchpad file I use to try things out. The only variables I had to create for the above process are CurrentElementText and CurrentElementRectangle.

1 Like

yeah it works, it gets texts. I think I can set this up to take screenshots. I am trying it

Hi @TAHA_YASIN_EREL

If your issue is resolved please mark the solution so that it helps others

Cheers

1 Like

thanks @postwick and especially @Anil_G :heart: . here is solution of my problem:
Test.xaml (17.3 KB)

1 Like

I just realized that the Take Screenshot activity accepts an input element. So you can just directly give it CurrentElement without worrying about finding the rectangle numbers and passing them.

image

image

Thx so much Paul. I just wonder which componets you added or removed? could you please share the your last example’s file? :heart:

The only thing I did was drop the Take Screenshot activity into For Each UI Element and pass it CurrentElement. It automatically uses the CurrentElement properties to take a screenshot of the correct screen area.

1 Like

Hi @postwick

Doesn’t it get all the child elements other than as opposing to it he needs only post photos not the separate elements of post again

Cheers

1 Like

No, you’re confusing For Each UI Element with Find Children. For Each UI Element allows you to designate an item on the screen and it’ll find (and loop through) all the similar elements. In my example the element I clicked was the first post title and it automatically found all post titles.

1 Like