2
String str = " <iframe width=\"640\" height=\"360\" src=\"https://www.youtube.com/embed/UMUeWqnwmjs\" frameborder=\"0\" allowfullscreen></iframe>";
이 태그에서 Src를 가져 오는 방법은?src/url을 가져 오는 방법 <iframe> 자바를 사용
String str = " <iframe width=\"640\" height=\"360\" src=\"https://www.youtube.com/embed/UMUeWqnwmjs\" frameborder=\"0\" allowfullscreen></iframe>";
이 태그에서 Src를 가져 오는 방법은?src/url을 가져 오는 방법 <iframe> 자바를 사용
그런 간단한 경우 regexp를 사용할 수 있습니다 (일반적으로 html 구문 분석에는 사용하지 말아야합니다). 아래 코드는 src를 찾고 검색합니다 :
Matcher matcher = Pattern.compile("src=\"([^\"]+)\"").matcher(str);
matcher.find();
String src = matcher.group(1);
src
에 iframe의 src가 포함됩니다.
#krzyk 감사합니다 .. <3 그 작품 ... – AMU