# How to get the main image of any news website

**URL:** <https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606>\
**Category:** Questions\
**Tags:** http\
**Created:** [February 15, 2024, 4:54pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606 "2024-02-15T16:54:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Gabriel\_Rodriguez](https://community.make.com/u/Gabriel_Rodriguez)\
**Post date:** [February 15, 2024, 4:54pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/1 "2024-02-15T16:54:35Z")

</div>

I need to get the url of the main image of different web sites on a Google Sheet cell.

I´m getting the HTML through a HTTP call, but if I use Get images and then parse them, I get so many bundles with images in different positions, and the image changes position depending on the source of the news.

Is it possible to select only the image based on the Meta Tag

?

 ![Image bundle 3](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/b/3/b3454b153bf9eb986a9831a473e4c04550203924.jpeg)

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [February 15, 2024, 5:42pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/2 "2024-02-15T17:42:00Z")

</div>

Welcome to the Make community!

What if there is no meta og:image tag?

---

<div class="post-metadata">

**Author:** ![alex.newpath](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/alex.newpath/32/84_2.png) [@alex.newpath](https://community.make.com/u/alex.newpath)\
**Post date:** [February 15, 2024, 6:04pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/3 "2024-02-15T18:04:31Z")

</div>

Which meta tag do you want to filter by? You can process each image result bundle and search for the presence of a string but I am not sure this is what you’re asking.

---

<div class="post-metadata">

**Author:** ![Gabriel\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Gabriel\_Rodriguez](https://community.make.com/u/Gabriel_Rodriguez)\
**Post date:** [February 16, 2024, 3:45pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/4 "2024-02-16T15:45:29Z")

</div>

Most news sites have it, but if not then I would have to find the main image of the post.

But there is also this HTML:

“image”: {  
“@type”: “ImageObject”,  
“url”: “[https://www.abc.com/imagespp/12354.jpg?w=900&h=500](https://www.abc.com/imagespp/12354.jpg?w=900&h=500)”,  
“width”: 900,  
“height”: 500  
}

I´m trying with RapidAPI - Extract News, but I´d like to know if is it possible to configure the HTTP module to do something like it…

> **[Extract News API Documentation (kotartemiy) | RapidAPI](https://rapidapi.com/kotartemiy/api/extract-news)**
>
> Pull structured data from online news articles

---

<div class="post-metadata">

**Author:** ![Gabriel\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Gabriel\_Rodriguez](https://community.make.com/u/Gabriel_Rodriguez)\
**Post date:** [February 16, 2024, 4:04pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/5 "2024-02-16T16:04:24Z")

</div>

I usually get from 15 to 18 bundles with images: the main post image is buried between logos and other kind of images.

Most news sites have this tag:

 ![Twitter meta](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/e/0/e01575efa4f0fc3527047dbbe1baeff4ccff2aee.jpeg)

So I´d like to find just that image to get it in a Google Sheet…

If there is no social media tag, there is also this HTML that I´d like to get out of the rest of the HTML:

“image”: {  
“@type”: “ImageObject”,  
“url”: “[https://www.abc.com/imagespp/12354.jpg?w=900&h=500](https://www.abc.com/imagespp/12354.jpg?w=900&h=500)”,  
“width”: 900,  
“height”: 500  
}

---

<div class="post-metadata">

**Author:** ![alex.newpath](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/alex.newpath/32/84_2.png) [@alex.newpath](https://community.make.com/u/alex.newpath)\
**Post date:** [February 16, 2024, 4:24pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/6 "2024-02-16T16:24:41Z")

</div>

Instead of using Get HTML elements in the Text Parser, use the Match Pattern module in the Text Parser. You can just get the HTML by calling the page with HTTP app/Make a request module, and the full HTML will be returned as a text string in the data object.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/4/1/415ce75fd834275ca6d70c9c20e36d95981a50ad.png)

> [@Gabriel\_Rodriguez](#):
>
> “image”: {  
> “@type”: “ImageObject”,  
> “url”: “[https://www.abc.com/imagespp/12354.jpg?w=900&h=500”](https://www.abc.com/imagespp/12354.jpg?w=900&h=500%E2%80%9D),  
> “width”: 900,  
> “height”: 500  
> }

This doesn’t seem to be HTML but rather a JSON collection. You can use the Text Parser and create a regular expression to look for the URL of the image with this regular expression. The named group will be called `URL`.

`\"url\"\s*:\s*\"(?<URL>http.+)\"`

You can also look for the meta property using this regular expression

`<meta\s*property\s*\=\s*\"twitter:image\"\s*content\s*=\s*\"(?<URL>http.+)\"\s*>`

---

<div class="post-metadata">

**Author:** ![Gabriel\_Rodriguez](https://avatars.discourse-cdn.com/v4/letter/g/91b2a8/32.png) [@Gabriel\_Rodriguez](https://community.make.com/u/Gabriel_Rodriguez)\
**Post date:** [March 30, 2024, 4:44pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/7 "2024-03-30T16:44:51Z")

</div>

Thanks for your suggestion. I tried but could not configure it in a fashion that I could get the main picture only. So I resolved it by adding a Pocket module that can do the trick. Thanks very much for the suggestions, I´ll keep on working on the mach pattern module later.

---

<div class="post-metadata">

**Author:** ![vendy](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/vendy/32/12635_2.png) [@vendy](https://community.make.com/u/vendy)\
**Post date:** [April 2, 2024, 8:41am UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/8 "2024-04-02T08:41:02Z")

</div>

Heya @Gabriel_Rodriguez 👋

Great to hear that you got the ball rolling with assistance from @samliew and @alex.newpath! ⚽

Thank you very much for sharing the solution that worked for you! This way we keep our community organized and neat for other users.

Keep up the good job!

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [April 13, 2024, 4:00pm UTC](https://community.make.com/t/how-to-get-the-main-image-of-any-news-website/27606/9 "2024-04-13T16:00:16Z")

</div>

This topic was automatically closed because it's resolved or inactive. Please, start a new topic.


