summaryrefslogtreecommitdiffstats
path: root/kadomatsu-rss.py
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2022-10-02 01:57:28 +0100
committergarret <garret@airmail.cc>2022-10-02 01:59:16 +0100
commit60169f977860c6c253ebf67e0bc288864cceaf05 (patch)
treed62a57b3b6270a396044063c130a585bc59eacdf /kadomatsu-rss.py
parent2bde259e56626016ced8b71b681276afe4176d4a (diff)
downloadkadomatsu-rss-60169f977860c6c253ebf67e0bc288864cceaf05.tar.gz
kadomatsu-rss-60169f977860c6c253ebf67e0bc288864cceaf05.tar.bz2
kadomatsu-rss-60169f977860c6c253ebf67e0bc288864cceaf05.zip
use a requests session
Diffstat (limited to 'kadomatsu-rss.py')
-rwxr-xr-xkadomatsu-rss.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/kadomatsu-rss.py b/kadomatsu-rss.py
index 29398d9..8a31c14 100755
--- a/kadomatsu-rss.py
+++ b/kadomatsu-rss.py
@@ -29,9 +29,10 @@ class Item:
self.url = url
self.content = content
+s = requests.Session()
def get_soup(url):
- site = requests.get(url)
+ site = s.get(url)
site.encoding = "utf-8"
soup = BeautifulSoup(site.text, "lxml")
return soup