Can I use Html Agility Pack To Parse HTML Fragment?
-
22-09-2019 - |
문제
Can Html Agility Pack be used to parse an html string fragment?
Such As:
var fragment = "<b>Some code </b>";
Then extract all <b>
tags? All the examples I seen so far have been loading like html documents.
해결책
If it's html then yes.
string str = "<b>Some code</b>";
// not sure if needed
string html = string.Format("<html><head></head><body>{0}</body></html>", str);
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(html);
// look xpath tutorials for how to select elements
// select 1st <b> element
HtmlNode bNode = doc.DocumentNode.SelectSingleNode("b[1]");
string boldText = bNode.InnerText;
다른 팁
기본 응용 프로그램 (기본 APK)이 여기에 정교화 된 것과 유사한 방식으로 이전에 다운로드 한 각 APK (i.e. : 외부 APK)를 인스턴스화하기 시작합니다.
는 안전하지 않고 코드 주입 공격의 가능성을 제공합니다.나는 10 피트 극으로 그 기술을 만지지 않을 것이다.
현재 똑바로 솔루션 / 작업 주위가 있습니다.
정말로 아닙니다.외부 설치되지 않은 APK에서 바이트 코드를 찢어보고 프로세스에서 실행 중입니다.당신은 어떻게 든 리소스를 찢어 버릴 수 없으며 당신과 혼합되게합니다.
제휴하지 않습니다 StackOverflow