mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-01 08:53:37 +00:00
13 lines
No EOL
292 B
Python
13 lines
No EOL
292 B
Python
from bs4 import BeautifulSoup
|
|
|
|
|
|
class BS4Parser:
|
|
def __init__(self, *args, **kwargs):
|
|
self.soup = BeautifulSoup(*args, **kwargs)
|
|
|
|
def __enter__(self):
|
|
return self.soup
|
|
|
|
def __exit__(self, exc_ty, exc_val, tb):
|
|
self.soup.clear(True)
|
|
self.soup = None |