avoid BeautifulSoup warning output since v4.9.3 (#1)
https://stackoverflow.com/questions/36039724/suppress-warning-of-url-in-beautifulsoup/78445796#78445796
This commit is contained in:
parent
4a3e3664ad
commit
324e90e1e4
1 changed files with 9 additions and 0 deletions
|
@ -18,6 +18,11 @@
|
||||||
# standard libraires imports
|
# standard libraires imports
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
# avoid BeautifulSoup warning output since v4.9.3
|
||||||
|
# https://stackoverflow.com/questions/36039724/suppress-warning-of-url-in-beautifulsoup/78445796#78445796
|
||||||
|
import warnings
|
||||||
|
from bs4 import MarkupResemblesLocatorWarning
|
||||||
|
|
||||||
# external liraries imports
|
# external liraries imports
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
@ -26,6 +31,10 @@ from feed2toot.addtags import AddTags
|
||||||
from feed2toot.removeduplicates import RemoveDuplicates
|
from feed2toot.removeduplicates import RemoveDuplicates
|
||||||
from feed2toot.tootpost import TootPost
|
from feed2toot.tootpost import TootPost
|
||||||
|
|
||||||
|
# avoid BeautifulSoup warning output since v4.9.3
|
||||||
|
# https://stackoverflow.com/questions/36039724/suppress-warning-of-url-in-beautifulsoup/78445796#78445796
|
||||||
|
warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning)
|
||||||
|
|
||||||
def build_message(entrytosend, tweetformat, rss, tootmaxlen, notagsintoot):
|
def build_message(entrytosend, tweetformat, rss, tootmaxlen, notagsintoot):
|
||||||
'''populate the rss dict with the new entry'''
|
'''populate the rss dict with the new entry'''
|
||||||
tweetwithnotag = tweetformat.format(**entrytosend)
|
tweetwithnotag = tweetformat.format(**entrytosend)
|
||||||
|
|
Loading…
Add table
Reference in a new issue