web/fetch
This commit is contained in:
parent
510371ef24
commit
ce64258fce
1 changed files with 8 additions and 0 deletions
|
@ -1,7 +1,15 @@
|
|||
import requests
|
||||
|
||||
from rwx import Object, txt
|
||||
from rwx.txt import CHARSET
|
||||
|
||||
|
||||
def fetch(url: str) -> str:
|
||||
response = requests.get(url)
|
||||
response.raise_for_status()
|
||||
return response.text
|
||||
|
||||
|
||||
class Page(Object):
|
||||
def __init__(self):
|
||||
self.charset = CHARSET
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue