xmlValue
保持する必要のあるタグを削除する<br />
(または、その後使用できる他の文字に変換する)という問題が発生strsplit
しています。
次に例を示します。
> f <- htmlParse(getForm("http://sites.target.com/site/en/spot/store_locator_popups.jsp", ajax="true", storeNumber=1889), asText=TRUE)
> xpathSApply(f, "//div[@class=\"sl_results_popup_address\"]", xmlValue)
[1] "1154 S Clark StChicago, IL 60605(312) 212-6300"
解析しているHTMLと比較して:
<div class="sl_results_popup_address">
1154 S Clark St
<br/>
Chicago, IL 60605
<br/>
(312) 212-6300
</div>
私は試しまし, recursive=FALSE
たが、それは役に立たないようです。
改行があれば、<p>
個別に取得できるので簡単ですが、テキストを折り返さないと、実際にはその方向に進むことができません。内部で行われるストリッピングのレベルを下げるオプションがあることを願っています(または、ドキュメントの解析フェーズでストリッピングされている可能性がありますか?)。</p>
<br/>
xmlValue
<br/>