<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>
<title>Вы искали глобальное потепление | New-Science.ru</title>
<atom:link href="https://new-science.ru/search/%D0%B3%D0%BB%D0%BE%D0%B1%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5+%D0%BF%D0%BE%D1%82%D0%B5%D0%BF%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5/feed/rss2/" rel="self" type="applica
tion/rss+xml" />
<link>https://new-science.ru</link>
<description>Актуальные новости научных открытий, высоких технологий, электроники и космоса.</description>
<lastBuildDate>Sat, 05 Apr 2025 17:04:46 +0000</lastBuildDate>
<language>ru-RU</language>
<sy:updatePeriod>
hourly </sy:updatePeriod>
<sy:updateFrequency>
1 </sy:updateFrequency>
<generator>https://wordpress.org/?v=6.7.2</generator>
<image>
<url>https://new-science.ru/wp-content/uploads/2019/08/favicon.png</url>
<title>Вы искали глобальное потепление | New-Science.ru</title>
<link>https://new-science.ru</link>
<width>32</width>
<height>32</height>
</image>
...
<item>
<title>Атмосферные реки мигрируют к полюсам, изменяя климат планеты</title>
<link>https://new-science.ru/atmosfernye-reki-migrirujut-k-poljusam-izmenyaya-klimat-planety/</link>
<dc:creator><![CDATA[New-Science.ru]]></dc:creator>
<pubDate>Wed, 27 Nov 2024 07:20:47 +0000</pubDate>
<category><![CDATA[Природа]]></category>
<guid isPermaLink="false">https://new-science.ru/?p=47504</guid>
<description><![CDATA[<img width="1200" height="525" src="https://new-science.ru/wp-content/uploads/2024/11/865-6.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="" st
yle="display: block; margin-bottom: 5px; clear:both;max-width: 100%;" link_thumbnail="" decoding="async" loading="lazy" srcset="https://new-science.ru/wp-content/uploads/2024/11/865-6.jpg 1200w, https://new-scienc
e.ru/wp-content/uploads/2024/11/865-6-768x336.jpg 768w" sizes="auto, (max-width: 1200px) 100vw, 1200px" />Атмосферные реки, мощные потоки водяного пара, взвешенного в атмосфере, уже несколько десятилетий движутся
неожиданным образом, изменяя характер осадков и климат в глобальном масштабе. Что такое атмосферная река? Атмосферные реки — это огромные потоки водяного пара, которые циркулируют в атмосфере и переносят количеств
о влаги, сравнимое с крупнейшими реками на Земле, такими как Миссисипи. Эти небесные реки …]]></description>
</item>
</channel>
</rss>
img_url = figure.find('source')['srcset']
from bs4 import BeautifulSoup
import requests
import fake_useragent
import os
ua = fake_useragent.UserAgent()
headers = {"User-Agent": ua.random}
url = 'https://new-science.ru/rasseivanie-almaznyh-nanochastic-v-stratosfere-mozhet-zamedlit-globalnoe-poteplenie/'
def get_files(link, folder='images'):
resp = requests.get(link, stream=True)
filename = os.path.basename(link)
if not os.path.isdir(folder):
os.mkdir(folder)
file = open(f"{folder}/{filename}", 'bw')
for chunk in resp.iter_content(4096):
file.write(chunk)
return filename
response = requests.get(url, headers=headers)
soup = BeautifulSoup(response.text, 'html.parser')
figure = soup.find('figure', class_ ="single-featured-image")
#img_url = figure.find('img')['src']
img_url = figure.find('source')['srcset']
get_files(img_url, 'images')
print(img_url)