blob: f02a8d4278a9134c99513e5077479a834787a353 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import requests
from bs4 import BeautifulSoup as bs
class RemoteUrl:
url_cache = {}
@classmethod
def fetch(cls, url):
if url not in cls.url_cache:
cls.url_cache[url] = requests.get(url).text
return bs(cls.url_cache[url], 'lxml')
|