"""Tests to ensure that the html5lib tree builder generates good trees."""
import warnings
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError as e:
HTML5LIB_PRESENT = False
from bs4.element import SoupStrainer
from bs4.testing import (
HTML5TreeBuilderSmokeTest,
SoupTest,
skipIf,
)
@skipIf(
not HTML5LIB_PRESENT,
"html5lib seems not to be present, not testing its tree builder.")
class HTML5LibBuilderSmokeTest(SoupTest, HTML5TreeBuilderSmokeTest):
"""See ``HTML5TreeBuilderSmokeTest``."""
@property
def default_builder(self):
return HTML5TreeBuilder()
def test_soupstrainer(self):
# The html5lib tree builder does not support SoupStrainers.
strainer = SoupStrainer("b")
markup = "
A bold statement.
"
with warnings.catch_warnings(record=True) as w:
soup = self.soup(markup, parse_only=strainer)
self.assertEqual(
soup.decode(), self.document_for(markup))
self.assertTrue(
"the html5lib tree builder doesn't support parse_only" in
str(w[0].message))
def test_correctly_nested_tables(self):
"""html5lib inserts tags where other parsers don't."""
markup = ('
\n", soup.body.decode())
self.assertEqual(2, len(soup.find_all('p')))
def test_processing_instruction(self):
"""Processing instructions become comments."""
markup = b""""""
soup = self.soup(markup)
assert str(soup).startswith("")
def test_cloned_multivalue_node(self):
markup = b""""""
soup = self.soup(markup)
a1, a2 = soup.find_all('a')
self.assertEqual(a1, a2)
assert a1 is not a2
“The amphibian!” cried Larry. “I wonder why——” “I did not see her,” Miss Serena replied to Sandy while she answered the older man’s question in the same breath. “But I saw a glimpse of dress just afterward.” Her expression showed confident assurance. “It’s time to find out what’s what!” he muttered. "De veras?" asked Cairness, sharply. He was of no mind to lose her like this, when he was so near his end. With his heart full of hope and joy, the Deacon bustled around to make every possible preparation for the journey. "We do," responded those kneeling at the altar. "Silence, Sergeant. Billings? Billings? The name of the Lieutenant-Colonel of the 200th Ind. happens to be McBiddle—one-armed man, good soldier. Billings? Billings? T. J. Billings? Is that your name?" "Pete," said Shorty solemnly as he finished trimming the switch, and replaced the knife in his pocket, "nobody's allowed to pick out his own daddy in this world. He just gits him. It's one o' the mysterious ways o' Providence. You've got me through one o' them mysterious ways o' Providence, and you can't git shet o' me. I'm goin' to lick you still harder for swearin' before your father, and sayin' disrespeckful words to him. And I'm goin' to lick you till you promise never to tech another card until I learn you you how to play, which'll be never. Come here, my son." "Leave me alone," Dodd said. "Just do me a favor. Leave me alone." "I cud m?ake something out of Boarzell." Should beauty forget now their nests have grown cold? Makes boil the rushing blood and thrills my very soul." "Because you gave those things up of your free will—they were made to give them up by force. You've no right to starve and deny other people as you have to starve and deny yourself." He rose to his feet. The kitchen was dark, with eddying sweeps of shadow in the corners which the firelight caressed—while a single star put faint ghostly romance into the window. "Oh, mother!" shrieked Margaret. "Fly!—to the abbey, and take sanctuary!" HoME大陆明星露点电影片段合集
ENTER NUMBET 0017 erli0.net.cn kedu.org.cn zonglila.com.cn www.mucai0.com.cn www.tumao9.com.cn juxin9.com.cn wufan7.net.cn www.baoke6.com.cn www.xiehe1.net.cn www.daoya3.com.cn