我只能得到第一家餐馆的名称,即#34; toit"使用这些命令:
self.itemDescription?.setContentCompressionResistancePriority(UILayoutPriority.Required, forAxis: .Vertical);
如何调整此项以从网页中提取所有餐馆名称?
答案 0 :(得分:3)
您需要使用html_nodes
而不是html_node
:
url %>% html_nodes("li a.result-title") %>% html_text()
[1] "Toit " "Truffles " "Church Street Social "
[4] "AB's - Absolute Barbecues " "Onesta " "The Black Pearl "
[7] "The Hole in the Wall Cafe " "Arbor Brewing Company " "Big Brewsky "
[10] "Chutney Chang " "Soho St. " "Glen's Bakehouse "
[13] "Fenny's Lounge And Kitchen " "SodaBottleOpenerWala " "The Black Rabbit "
[16] "High Ultra Lounge " "Prost Brew Pub " "LOFT38 "
[19] "Windmills Craftworks " "Smoke House Deli " "Tim Tai "
[22] "Vapour Pub & Brewery " "Big Pitcher " "Punjab Grill "
[25] "Brewsky " "Hard Rock Cafe " "The Boozy Griffin "
[28] "The Glass House - Deli Bistro Bar " "The Fatty Bao - Asian Gastro Bar " "Monkey Bar "