diff options
author | garret <garret@airmail.cc> | 2022-10-02 01:57:28 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2022-10-02 01:59:16 +0100 |
commit | 60169f977860c6c253ebf67e0bc288864cceaf05 (patch) | |
tree | d62a57b3b6270a396044063c130a585bc59eacdf | |
parent | 2bde259e56626016ced8b71b681276afe4176d4a (diff) | |
download | kadomatsu-rss-60169f977860c6c253ebf67e0bc288864cceaf05.tar.gz kadomatsu-rss-60169f977860c6c253ebf67e0bc288864cceaf05.tar.bz2 kadomatsu-rss-60169f977860c6c253ebf67e0bc288864cceaf05.zip |
use a requests session
-rwxr-xr-x | kadomatsu-rss.py | 3 |
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 |